本文整理汇总了C++中Environment::addDrone方法的典型用法代码示例。如果您正苦于以下问题:C++ Environment::addDrone方法的具体用法?C++ Environment::addDrone怎么用?C++ Environment::addDrone使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Environment
的用法示例。
在下文中一共展示了Environment::addDrone方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: main
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();
}
示例2: main
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();
}