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
6d07537f
Commit
6d07537f
authored
Mar 13, 2019
by
Ahmad Reza
Browse files
Bug-Fix with delete_matter_in
Create_scenario changed to only scenario
parent
65b7d6fc
Changes
8
Hide whitespace changes
Inline
Side-by-side
config.ini
View file @
6d07537f
...
...
@@ -7,7 +7,7 @@ seedvalue = 12
max_round
=
30
# Visualization 1 = On, 0 = Off
visualization
=
0
visualization
=
1
## 1 = Call of particles in randmom order
## 0 = Call of particles in added order in scenario
...
...
run.py
View file @
6d07537f
"""This is the main module of the
Opportunistic Robotics Network Simulator
"""
"""This is the main module of the
Swarm-Sim
"""
import
configparser
...
...
@@ -11,9 +11,7 @@ from datetime import datetime
from
lib
import
sim
#visualization=True
def
core
(
argv
):
def
swarm_sim
(
argv
):
"""In the main function first the config is getting parsed and than
the simulator and the sim object is created. Afterwards the run method of the simulator
is called in which the simlator is going to start to run"""
...
...
@@ -100,5 +98,5 @@ def core(argv):
if
__name__
==
"__main__"
:
core
(
sys
.
argv
[
1
:])
swarm_sim
(
sys
.
argv
[
1
:])
scenario/between_particle_one_tile_particle.py
View file @
6d07537f
...
...
@@ -2,7 +2,7 @@
A sim is created that has two particles, two locations, and two tiles.
"""
def
create_
scenario
(
sim
):
def
scenario
(
sim
):
sim
.
add_particle
(
0
,
0
)
sim
.
add_particle
(
-
1
,
0
)
sim
.
add_tile
(
1
,
0
)
scenario/lonely_particle.py
View file @
6d07537f
def
create_
scenario
(
sim
):
def
scenario
(
sim
):
sim
.
add_particle
(
0
,
0
)
#sim.add_tile(0, 0)
...
...
scenario/particles_tiles_locations_ring.py
View file @
6d07537f
...
...
@@ -4,7 +4,7 @@ A sim is created that has particles formated in a ring structure that is up to 5
def
create_
scenario
(
sim
):
def
scenario
(
sim
):
sim
.
add_particle
(
0
,
0
,
color
=
3
)
# 1st ring
sim
.
add_particle
(
1.000000
,
0.000000
,
color
=
1
)
...
...
scenario/test_interfaces.py
View file @
6d07537f
"""
A sim is created that has particles formated in a ring structure that is up to 5 hops big
"""
def
create_
scenario
(
sim
):
def
scenario
(
sim
):
sim
.
add_particle
(
0
,
0
,
color
=
3
)
sim
.
add_tile
(
1.0
,
0.0
)
sim
.
add_location
(
3.0
,
2.0
)
...
...
scenario/two_particles_tiles_locations.py
View file @
6d07537f
...
...
@@ -2,7 +2,7 @@
A sim is created that has two particles, two locations, and two tiles.
"""
def
create_
scenario
(
sim
):
def
scenario
(
sim
):
sim
.
add_particle
(
0
,
0
)
sim
.
add_particle
(
1
,
0
)
sim
.
add_location
(
0.5
,
1
)
...
...
system.log
View file @
6d07537f
Started
Created particle at (0, 0)
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 3
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 2
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 5
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 4
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 5
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 2
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 1
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 3
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 0
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 2
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 3
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 2
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 5
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 3
particle
79ec2b33-4a96-430b-baa6-13e04b8328d
3 successfully moved to 5
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 3
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 2
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 5
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 4
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 5
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 2
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 1
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 3
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 0
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 2
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 3
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 2
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 5
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 3
particle
2996d6aa-2470-4f63-9ee6-27f6dfcd5e6
3 successfully moved to 5
Finished
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