Exemplo n.º 1
0
int main(int argv, char* argc[]){
	(void)argv;
	(void)argc;

	//create the sensor map and optionally add in some data
	std::map<std::string, data_type>* sensor_map = new std::map<std::string, data_type>;
	//data_type* sensor_data = new data_type();
	//sensor_map.insert(std::pair<std::string, int>("blank", sensor_data));

	//create the environment and comm module
	Environment* env = new Environment(*sensor_map, 1.0, false);
	std::atomic_flag stdout_lock = ATOMIC_FLAG_INIT;

	CommMod* comm_basic1 = new Basic(env, &stdout_lock);
	CommMod* comm_basic2 = new Basic(env, &stdout_lock);
	CommMod* comm_dummy = new Dummy_comm(env);

	//create and add drones
	BasicTest* drone1 = new BasicTest(comm_basic1, 0.0, 0.0, 0.0, 0.0, env, false);
	BasicTest* drone2 = new BasicTest(comm_basic2, 1.0, 1.0, 0.0, 0.0, env, true);
	Dummy_program* base = new Dummy_program(comm_dummy, 0.0, 0.0, 0.0);
	env->addDrone(drone1);
	env->addDrone(drone2);
	env->setBaseStation(base);

	//run the simulation
	env->run();
}
Exemplo n.º 2
0
int main(int argv, char* argc[]){
	(void)argv;
	(void)argc;
	
	//create the sensor map and optionally add in some data
	std::map<std::string, data_type>* sensor_map = new std::map<std::string, data_type>;

	//create the environment and comm module
	Environment* env = new Environment(*sensor_map, "10.0.0.2");
	std::atomic_flag stdout_lock = ATOMIC_FLAG_INIT;

	CommMod* comm_basic = new Basic(env, &stdout_lock);
	CommMod* comm_dummy = new Dummy_comm(env);

	//create and add drones
	Dummy_program* base = new Dummy_program(comm_dummy, 0.0, 0.0, 0.0);
	TakeOff* drone1 = new TakeOff(comm_basic, 0.0, 0.0, 0.0, 1.0, env, true);
	env->addDrone(drone1);
	env->setBaseStation(base);

	//run the simulation
	env->run();
}