Commit 36366baa authored by Ahmad Reza's avatar Ahmad Reza
Browse files

Merge remote-tracking branch 'origin/master'

parents 52137267 dad30692
Before the ORN Simulator can be started, its simulation world has to be created.
At lease one particle should be created that takse the action of the world.
For creating a particle just create a python file e.g. one_particle_world.py
in the folder robtotsOnTiles/worlds/ and insert the following code:
def create_world(self):
self.add_particle(0,0)
That is all and you created a particle.
The same thing you can do it with creating locations and tiles. E.g creating two particles, tiles, and locations.
You have to create a python file e.g. two_particles_tiles_locations.py in robtotsOnTiles/worlds/ and insert the following code:
def create_world(self):
self.add_particle(0, 0)
self.add_particle(1, 0)
self.add_location(2, 0)
self.add_tile(-1, 0)
Before the ORN Simulator can be started, its simulation world has to be created.
At lease one particle should be created that takse the action of the world.
For creating a particle just create a python file e.g. one_particle_world.py
in the folder robtotsOnTiles/worlds/ and insert the following code:
def create_world(self):
self.add_particle(0,0)
That is all and you created a particle.
How to add a Scenario
===============
A scenario tells the ORN simulator what to do while using the provided interfaces of the ORN simulator.
The scenario module is called from the sim.py. That means that it can use all the instances of
sim.py. The most important one is the __max_round, __round_counter and __seed.
For adding a scenarion create a in the folder robotsOnTiles/scenarios a python file e.g. yourscenario.py
and instert the following code inside:
import logging #just needed for printing outputs in the log file
#the provided directions
E = 0
SE = 1
SW = 2
W = 3
NW = 4
NE = 5
S = 6 # S for stop and not south
direction = [E, SE, SW, W, NW, NE] #direction list
def scenario(self, world):
"""
All the magic starts from here
:param self: The object instance of the sim.py
:param world: The object instance of the created world
"""
For running the Opportunistic Robotics Network (ORN) Simulator python 3.6 has to be installed.
For Linux following commands can be run on the terminal:
Step 1:
sudo apt-get install build-essential checkinstall
sudo apt-get install libreadline-gplv2-dev libncursesw5-dev libssl-dev libsqlite3-dev tk-dev libgdbm-dev libc6-dev libbz2-dev
Step 2 -Download the python 3.6 (e.g. 3.6.4) source code:
cd /usr/src
sudo wget https://www.python.org/ftp/python/3.6.4/Python-3.6.4.tgz
sudo tar xzf Python-3.6.4.tgz
Step 3 -Compile Python Source:
cd Python-3.6.4
sudo ./configure --enable-optimizations
sudo make altinstall
Step 4 -Check the Python Version:
python3.6 -V
Step 5 -Running the ORN Simulator:
cd ORN/
python3.6 main.py
What and where is something generated
===============
The ORN simulator creates after a simulation run and output file as comma separated values in the folder
outputs/Date_Time_ScenarionName_Seed#
The outputs files are:
particles.csv
aggregate_rounds.csv
rounds.csv
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment