SimulatorGUI.cpp File Reference
#include "SimulatorGUI.hpp"
#include <cstdlib>
#include <ctime>
#include <iostream>
#include <unistd.h>
Include dependency graph for SimulatorGUI.cpp:

Go to the source code of this file.

Functions

int main (int argc, const char **argv)
 

Function Documentation

int main ( int  argc,
const char **  argv 
)

Definition at line 82 of file SimulatorGUI.cpp.

83 {
84  int x=20, y=20, skill_points=20, bots_per_player=5, obstacles=30, naptime=3;
85  if(argc>=6)
86  {
87  x=atoi(argv[1]);
88  y=atoi(argv[2]);
89  skill_points=atoi(argv[3]);
90  bots_per_player=atoi(argv[4]);
91  obstacles=atoi(argv[5]);
92  }
93  if(argc==7)
94  naptime=atoi(argv[6]);
95  if(argc==2)
96  naptime=atoi(argv[1]);
97 
98  //RNG should be seeded before simulation
99  //srand(time(NULL));
100 
101  SimulatorGUI gui{x,y,skill_points,bots_per_player,obstacles};
102  try
103  {
104  while(gui.do_timestep())
105  sleep(naptime);
106  }
108  {
109  cout << "Failed with Robot Exception: " << e.msg << endl;
110  }
111 
112  return 0;
113 }
int x
Definition: test.cpp:1