Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ahmad Reza Cheraghi
SwarmNetworkSimulator
Commits
a162ff01
Commit
a162ff01
authored
Apr 25, 2018
by
Ahmad Reza Cheraghi
Browse files
Upload New File
parent
ad93063e
Changes
1
Show whitespace changes
Inline
Side-by-side
robotsOnTiles/scenarios/take_drop_tile.py
0 → 100644
View file @
a162ff01
"""
This scenario just scans for particles that are within 5 hops range and prints them out.
"""
import
logging
from
locale
import
str
E
=
0
SE
=
1
SW
=
2
W
=
3
NW
=
4
NE
=
5
def
scenario
(
sim
,
world
):
if
sim
.
get_actual_round
()
==
1
:
all_aims_list
=
world
.
get_particle_coords_map
()[(
0
,
0
)].
scan_for_aim_within
(
aim
=
'tiles'
)
for
list
in
all_aims_list
:
if
list
.
type
==
'tile'
:
print
(
"tile"
,
list
.
coords
)
elif
sim
.
get_actual_round
()
==
2
:
world
.
get_particle_list
()[
0
].
take_tile_in
(
E
)
elif
sim
.
get_actual_round
()
==
4
:
world
.
get_particle_list
()[
0
].
drop_tile
()
elif
sim
.
get_actual_round
()
==
5
:
world
.
get_particle_list
()[
0
].
take_tile
()
elif
sim
.
get_actual_round
()
==
6
:
world
.
get_particle_list
()[
0
].
drop_tile_in
(
W
)
\ 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