Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class PredatorPreyView : public artis::observer::View<artis::common::DoubleTime> {
- public:
- PredatorPreyView()
- {
- selector("PredatorView",
- {PreyPredatorGraphManager::PREDATOR, PredatorGraphManager::S_Integrator,
- artis::pdevs::qss::Integrator<artis::common::DoubleTime>::VALUE});
- selector("PreyView",
- {PreyPredatorGraphManager::PREY, PreyGraphManager::S_Integrator,
- artis::pdevs::qss::Integrator<artis::common::DoubleTime>::VALUE});
- }
- };
- void run_predator_prey()
- {
- PreyPredatorGraphManagerParameters parameters = {{{45.},
- {true, true, 0.1, 3},
- {0.5, 0.01, 0.01, 0.2}},
- {{5000.},
- {true, true, 1, 3},
- {0.5, 0.01, 0.01, 0.2}}};
- artis::common::context::Context<artis::common::DoubleTime> context(0, 100);
- artis::common::RootCoordinator<
- artis::common::DoubleTime, artis::pdevs::Coordinator<
- artis::common::DoubleTime,
- PreyPredatorGraphManager,
- PreyPredatorGraphManagerParameters>
- > rc(context, "root", parameters, artis::common::NoParameters());
- rc.attachView("Value1", new PredatorPreyView());
- rc.run(context);
- artis::observer::Output<artis::common::DoubleTime> output(rc.observer());
- output(0, 100, 0.1);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement