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
swarm-sim
Commits
370907ab
Commit
370907ab
authored
Sep 18, 2019
by
Ahmad Reza
Browse files
Merge remote-tracking branch 'origin/master'
Conflicts: lib/particle.py solution/random_walk.py
parents
170a94e9
3157195a
Changes
3
Expand all
Show whitespace changes
Inline
Side-by-side
lib/particle.py
View file @
370907ab
This diff is collapsed.
Click to expand it.
lib/world.py
View file @
370907ab
...
...
@@ -80,6 +80,14 @@ class World:
self
.
csv_round
.
success
()
self
.
set_end
()
def
get_max_round
(
self
):
"""
The max round number
:return: maximum round number
"""
return
self
.
config_data
.
max_round
def
get_actual_round
(
self
):
"""
The actual round number
...
...
solution/random_walk.py
View file @
370907ab
...
...
@@ -2,7 +2,8 @@ import random
#Standard Lib that has to be in each solution
from
solution.std_lib
import
*
def
solution
(
world
):
if
world
.
get_actual_round
()
%
1
==
0
:
for
particle
in
world
.
get_particle_list
():
particle
.
move_to
(
random
.
choice
(
direction
))
\ No newline at end of file
Write
Preview
Supports
Markdown
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