horseplay / antix Goto Github PK
View Code? Open in Web Editor NEWThis project forked from rtv/antix
foraging simulator
This project forked from rtv/antix
foraging simulator
STARTING THE SIMULATION ====================================================================== SCRIPT RUN SEQUENCE ====================================================================== 1. Change directory to Controller/ 2. Fix the settings in configuration.py to the proper values. 3. Make sure you have the following files: - grid.config - drawer.config 4. See below for how to format these files. 5. Command for running everything: python controller.py SFU_USERNAME PATH_TO_ANTIX grid.config drawer.config The output for remote processes is piped to ~/antix.machine_name.out, and to ~/antix.nameX.out for local processes. 6. When you want to kill all the processes on every machine, run: python killthemall.py SFU_USERNAME Note: To see output from individual processes in your home directory (in files called antix.machine.out), you must disable stdout buffering. Add the following line to your code, somewhere near the top: setbuf(stdout, NULL); MANUAL RUN SEQUENCE ====================================================================== 1.) Clock 2.) Grid Servers 3.) ControllerClient 4.) RobotClients 5.) Drawer RUN: Clock ====================================================================== Description: The clock helps keep the simulation in sync. How to: ./clock.bin -p {{port}} -c {{# of robot clients}} -g {{# of grid servers}} Configuration file: None. RUN: Grid Servers ====================================================================== Description: The grid servers are the robot's playing field. How to: ./grid.bin -f {{config file}} -p {{port}} Configuration file: NUMBER_OF_TEAMS {{integer}} # Required: specifies the number of teams on the grid ROBOTS_PER_TEAM {{integer}} # Required: specified the number of robots per team CLOCK {{IP ADDRESS}} {{port}} NUM_CLIENTS {{integer}} # Required: specified the number of robots clients RUN: ControllerClient ====================================================================== Description: ControllerClient The ControllerClient regulates the simulation How to: ./controller.bin -f {{config file}} Configuration file: HOME_RADIUS {{float}} WORLD_SIZE {{integer}} NUM_GRIDS {{integer}} PUCK_TOTAL {{integer}} GRID {{IP Address}} {{port}} CLOCK {{IP Address}} {{port}} RUN: RobotClient ====================================================================== Description: RobotClients The RobotClients are the clients who will take part in the simulation. How to: ./robot.bin -f {{config file}} Configuration file: GRID {{ID}} {{IP ADDRESS}} {{port}} CLOCK {{IP ADDRESS}} {{port}} INIT_GRID {{ID}} # will request a team from this grid RUN: Drawer ====================================================================== Description: Drawer The Drawer is responsible for taking the information passed by the GridServers and drawing them. How to: ./drawer.bin -f {{config file}} Configuration file: WINDOW_SIZE {{integer}} WORLD_SIZE {{float}} HOME_RADIUS {{float}} ENABLE_FOV {{ 'T' or 'F' }} TOTAL_NUM_TEAMS {{integer}} TOTAL_NUM_ROBOTS {{integer}} TOTAL_NUM_PUCKS {{integer}} [ FOV_ANGLE {{float}} ] [ FOV_RANGE {{float}} ] GRID {{id}} {{IP ADDRESS}} {{port}}
FILE_PARSER STATUS: Handeling line GRID 1 127.0.0.1 10000
PARSED: GRID ID 1 with IP 127.0.0.1 and PORT 10000
CLIENT STATUS: Connection to host:127.0.0.1:10000
send left = 0
FILE_PARSER STATUS: Handeling line GRID 2 127.0.0.1 10001
PARSED: GRID ID 2 with IP 127.0.0.1 and PORT 10001
CLIENT STATUS: Connection to host:127.0.0.1:10001
send left = 0
FILE_PARSER STATUS: Empty line read
nfd: 1
MSG_GRIDTEAMS: Expecting 1 teams.
Team: id=0 x=588.000000 y=127.000000
MSG_GRIDTEAMS: Finished.
Segmentation fault
Robots need to draw with their team colors
Home locations need to draw, with colors, they also need to be more distinguishable from other robots.
Object: id=1000001 x=8.722433 y=8.684833 angle=0.000000 puck=0
Object type=0, id=1000001
Robot doesn't exist at 1000001
Object: id=1000002 x=1.043242 y=3.789894 angle=0.000000 puck=0
Object type=0, id=1000002
Robot doesn't exist at 1000002
Object: id=1000003 x=2.536704 y=5.029928 angle=0.000000 puck=0
Object type=0, id=1000003
Robot doesn't exist at 1000003
Object: id=1000004 x=6.012843 y=0.749733 angle=0.000000 puck=0
Object type=0, id=1000004
Robot doesn't exist at 1000004
Object: id=1000005 x=7.561574 y=0.411881 angle=0.000000 puck=0
Object type=0, id=1000005
Robot doesn't exist at 1000005
Object: id=1000006 x=3.195589 y=3.369955 angle=0.000000 puck=0
Object type=0, id=1000006
Robot doesn't exist at 1000006
4760: robots=100 pucks=6.
Grid Sends:
Object: id=1 x=6.190003 y=1.122271 angle=0.000000 puck=0 grid=512
Object: id=1 x=6.190003 y=1.122271 angle=0.000000 puck=0 grid=512
Object: id=1 x=6.190003 y=1.122271 angle=0.000000 puck=0 grid=512
Object: id=1 x=6.190003 y=1.122271 angle=0.000000 puck=0 grid=512
Drawer Receives:
4757: Expecting 106 objects.
Object: id=1 x=6.190003 y=1.122271 angle=0.000000 puck=0
Object type=0, id=1
4758: Expecting 106 objects.
Object: id=1 x=6.190003 y=1.122271 angle=0.000000 puck=0
Object type=0, id=1
4759: Expecting 106 objects.
Object: id=1 x=6.190003 y=1.122271 angle=0.000000 puck=0
Object type=0, id=1
4760: Expecting 106 objects.
Object: id=1 x=6.190003 y=1.122271 angle=0.000000 puck=0
Object type=0, id=1
int grid_id needs to be a uniquily assigned id from Controller for RobotClient to initgrid in commit f0aa0c9
After connecting Clock, GridServer and RobotClient, GridServer thows segfault at:
gridGameInstance->getRobots(l_Team, l_robots);
Parsing file
Handeling line NUMBER_OF_TEAMS 1
Entering handler
PARSED: Number of teams: 1
Handeling line ROBOTS_PER_TEAM 10
Entering handler
PARSED: Robots Per Team: 10
Handeling line ID_RANGE 1 1
Entering handler
PARSED: ID Range from 1 TO 1
Empty line read
hasrange=1 hasnumteams=1 hasperteam=1
Attempting to create a server socket on port: 10001
Server initialized and listening on port: 10001
A client connected.
3, 2
ts
Segmentation fault
Puck ID's start at 1000001, Robot ID's start at 1, we wont be able to have more then 1000000 robots due to this implementation.
This will need to be fixed later if we want to break the 1M mark.
Question from 01/22/2011 Meeting: Is the final system, where the AI competition will occur, going to be composed of many different parts from amongst the class teams, or the single system built within a team?
In GridServer.cpp, case SENDER_CONTROLLER, handle the event that the controller tells a gridserver about a new neighbour.
fd5ff67#L2L44
Needs RS clarification: The home base of different teams can overlap. Is this a bug?
As a side note, I don't think this should affect anything other than AI strategy, so it's not that big of an issue (yet).
The Controller Script needs to launch a GridServer on a Host, then launch a RobotClient on the same Host and let that RobotClient take control of teams in the local Host's GridServer.
This will allow us to better utilize the machines in CSIL, as GridServer is CPU bound, and RobotClient is IO bound. This way, due to Robots being attracted to their home locations, RobotClient to GridServer communication will be done through IPC instead of LAN.
RobotClient fails to continue execution after this line:
unsigned int l_MessageSize = l_Robo.size*l_NumRobots.msgSize;
printf("%ui\n", l_MessageSize);
About to readfile
Parsing file
Handeling line GRID 1 127.0.0.1 10002
Entering handler
PARSED: GRID ID 1 with IP 127.0.0.1 and PORT 10002
Connection to host:127.0.0.1:10002
Handeling line CLOCK 127.0.0.1 10003
Entering handler
PARSED: CLOCK with IP 127.0.0.1 and PORT 10003
Connection to host:127.0.0.1:10003
Handeling line INIT_GRID 1
Entering handler
PARSED: INIT_GRID with ID 1
Initializing a new grid.
send left = 0
Handeling line INIT_GRID 1
Entering handler
PARSED: INIT_GRID with ID 1
Initializing a new grid.
send left = 0
Empty line read
Done reading files
Handling file descriptor: 5
Received message 24 from 2
Receiving robot ids and positions for a team.
Expecting ids and positions for 6723 robots.
80676i
When the total number of robots/pucks exceeds 30000.
Scenario 1: glibc detected
Scenario 2: new robots and pucks before receiving messages, "stack smashing detected"
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.