Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
2
2022-020
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
O.V.B Sewmina
2022-020
Commits
0e0508f7
Commit
0e0508f7
authored
Nov 15, 2022
by
A.P.R.C. Abeyrathna
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Research Completed Finally
parent
965a558d
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
0 deletions
+36
-0
app/src/main/python/test.py
app/src/main/python/test.py
+36
-0
No files found.
app/src/main/python/test.py
0 → 100644
View file @
0e0508f7
from
helpers
import
load_map_train
,
load_map_test
,
load_map_bus
ANSWERS
=
[
(
1
,
5
,
10
,
[
5
,
6
,
7
,
8
,
9
,
10
]),
(
1
,
5
,
5
,
[
5
]),
(
1
,
3
,
18
,
[
3
,
2
,
1
,
16
,
17
,
18
]),
(
1
,
14
,
18
,
[
14
,
15
,
16
,
17
,
18
]),
(
1
,
15
,
2
,
[
15
,
16
,
1
,
2
])
]
def
test
(
path_planner_function
):
print
(
'testing started ---------------'
)
correct
=
0
for
mapval
,
start
,
goal
,
answer_path
in
ANSWERS
:
if
mapval
==
3
:
map
=
load_map_train
()
elif
mapval
==
2
:
map
=
load_map_bus
()
else
:
map
=
load_map_test
()
path
=
path_planner_function
(
map
,
start
,
goal
)
.
path
if
path
==
answer_path
:
correct
+=
1
print
(
"For start:"
,
start
,
"Goal: "
,
goal
,
"Your path:"
,
path
,
"Correct: "
,
answer_path
)
else
:
print
(
"Error Testing faild !!!"
)
if
correct
==
len
(
ANSWERS
):
print
(
"All tests pass "
)
else
:
print
(
"Only passed"
,
correct
,
"/"
,
len
(
ANSWERS
),
"test cases"
)
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment