mixed_tests.hpp 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796
  1. /**
  2. * @file mixed_examples.hpp
  3. * @author The PARADEVS Development Team
  4. * See the AUTHORS or Authors.txt file
  5. */
  6. /*
  7. * PARADEVS - the multimodeling and simulation environment
  8. * This file is a part of the PARADEVS environment
  9. *
  10. * Copyright (C) 2013 ULCO http://www.univ-litoral.fr
  11. *
  12. * This program is free software: you can redistribute it and/or modify
  13. * it under the terms of the GNU General Public License as published by
  14. * the Free Software Foundation, either version 3 of the License, or
  15. * (at your option) any later version.
  16. *
  17. * This program is distributed in the hope that it will be useful,
  18. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  19. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  20. * GNU General Public License for more details.
  21. *
  22. * You should have received a copy of the GNU General Public License
  23. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  24. */
  25. #include <common/RootCoordinator.hpp>
  26. #include <common/scheduler/VectorScheduler.hpp>
  27. #include <common/scheduler/HeapScheduler.hpp>
  28. #include <common/Time.hpp>
  29. #include <common/Trace.hpp>
  30. #include <dtss/Coordinator.hpp>
  31. #include <dtss/Dynamics.hpp>
  32. #include <dtss/GraphManager.hpp>
  33. #include <dtss/Simulator.hpp>
  34. #include <pdevs/Coordinator.hpp>
  35. #include <pdevs/Dynamics.hpp>
  36. #include <pdevs/GraphManager.hpp>
  37. #include <pdevs/Simulator.hpp>
  38. namespace paradevs {
  39. template < typename T >
  40. struct Limits
  41. {
  42. static constexpr T negative_infinity =
  43. -std::numeric_limits < T >::infinity();
  44. static constexpr T positive_infinity =
  45. std::numeric_limits < T >::infinity();
  46. static constexpr T null = 0;
  47. };
  48. typedef paradevs::common::Time < double, Limits < double > > MyTime;
  49. class A1 : public paradevs::pdevs::Dynamics < MyTime >
  50. {
  51. public:
  52. A1(const std::string& name) : paradevs::pdevs::Dynamics < MyTime >(name)
  53. { }
  54. virtual ~A1()
  55. { }
  56. void dint(typename MyTime::type t)
  57. {
  58. #ifndef WITH_TRACE
  59. (void)t;
  60. #endif
  61. #ifdef WITH_TRACE
  62. common::Trace < MyTime >::trace() <<
  63. common::TraceElement < MyTime >(get_name(), t,
  64. common::DELTA_INT);
  65. common::Trace < MyTime >::trace().flush();
  66. #endif
  67. if (_phase == SEND) {
  68. _phase = WAIT;
  69. }
  70. }
  71. void dext(typename MyTime::type t, typename MyTime::type /* e */,
  72. const common::Bag < MyTime >& msgs)
  73. {
  74. #ifndef WITH_TRACE
  75. (void)t;
  76. (void)msgs;
  77. #endif
  78. #ifdef WITH_TRACE
  79. common::Trace < MyTime >::trace()
  80. << common::TraceElement < MyTime >(get_name(), t,
  81. common::DELTA_EXT)
  82. << "messages = " << msgs.to_string();
  83. common::Trace < MyTime >::trace().flush();
  84. #endif
  85. _phase = SEND;
  86. }
  87. void dconf(typename MyTime::type t, typename MyTime::type /* e */,
  88. const common::Bag < MyTime >& msgs)
  89. {
  90. #ifndef WITH_TRACE
  91. (void)t;
  92. (void)msgs;
  93. #endif
  94. #ifdef WITH_TRACE
  95. common::Trace < MyTime >::trace()
  96. << common::TraceElement < MyTime >(get_name(), t,
  97. common::DELTA_CONF)
  98. << "messages = " << msgs.to_string();
  99. common::Trace < MyTime >::trace().flush();
  100. #endif
  101. }
  102. typename MyTime::type start(typename MyTime::type t)
  103. {
  104. #ifndef WITH_TRACE
  105. (void)t;
  106. #endif
  107. #ifdef WITH_TRACE
  108. common::Trace < MyTime >::trace()
  109. << common::TraceElement < MyTime >(get_name(), t,
  110. common::START);
  111. common::Trace < MyTime >::trace().flush();
  112. #endif
  113. _phase = WAIT;
  114. return 0;
  115. }
  116. typename MyTime::type ta(typename MyTime::type t) const
  117. {
  118. #ifndef WITH_TRACE
  119. (void)t;
  120. #endif
  121. #ifdef WITH_TRACE
  122. common::Trace < MyTime >::trace()
  123. << common::TraceElement < MyTime >(get_name(), t,
  124. common::TA);
  125. common::Trace < MyTime >::trace().flush();
  126. #endif
  127. if (_phase == WAIT) {
  128. return 1;
  129. } else {
  130. return 0;
  131. }
  132. }
  133. common::Bag < MyTime > lambda(typename MyTime::type t) const
  134. {
  135. #ifndef WITH_TRACE
  136. (void)t;
  137. #endif
  138. common::Bag < MyTime > msgs;
  139. msgs.push_back(common::ExternalEvent < MyTime >("out", 0.));
  140. #ifdef WITH_TRACE
  141. common::Trace < MyTime >::trace()
  142. << common::TraceElement < MyTime >(get_name(), t,
  143. common::LAMBDA)
  144. << "messages = " << msgs.to_string();
  145. common::Trace < MyTime >::trace().flush();
  146. #endif
  147. return msgs;
  148. }
  149. private:
  150. enum Phase { WAIT, SEND };
  151. Phase _phase;
  152. };
  153. class B1 : public paradevs::pdevs::Dynamics < MyTime >
  154. {
  155. public:
  156. B1(const std::string& name) : paradevs::pdevs::Dynamics < MyTime >(name)
  157. { }
  158. virtual ~B1()
  159. { }
  160. void dint(typename MyTime::type t)
  161. {
  162. #ifndef WITH_TRACE
  163. (void)t;
  164. #endif
  165. #ifdef WITH_TRACE
  166. common::Trace < MyTime >::trace()
  167. << common::TraceElement < MyTime >(get_name(), t,
  168. common::DELTA_INT);
  169. common::Trace < MyTime >::trace().flush();
  170. #endif
  171. if (_phase == SEND) {
  172. _phase = WAIT;
  173. }
  174. }
  175. void dext(typename MyTime::type t, typename MyTime::type /* e */,
  176. const common::Bag < MyTime >& msgs)
  177. {
  178. #ifndef WITH_TRACE
  179. (void)t;
  180. (void)msgs;
  181. #endif
  182. #ifdef WITH_TRACE
  183. common::Trace < MyTime >::trace()
  184. << common::TraceElement < MyTime >(get_name(), t,
  185. common::DELTA_EXT)
  186. << "messages = " << msgs.to_string();
  187. common::Trace < MyTime >::trace().flush();
  188. #endif
  189. _phase = SEND;
  190. }
  191. void dconf(typename MyTime::type t, typename MyTime::type /* e */,
  192. const common::Bag < MyTime >& msgs)
  193. {
  194. #ifndef WITH_TRACE
  195. (void)t;
  196. (void)msgs;
  197. #endif
  198. #ifdef WITH_TRACE
  199. common::Trace < MyTime >::trace()
  200. << common::TraceElement < MyTime >(get_name(), t,
  201. common::DELTA_CONF)
  202. << "messages = " << msgs.to_string();
  203. common::Trace < MyTime >::trace().flush();
  204. #endif
  205. }
  206. typename MyTime::type start(typename MyTime::type t)
  207. {
  208. #ifndef WITH_TRACE
  209. (void)t;
  210. #endif
  211. #ifdef WITH_TRACE
  212. common::Trace < MyTime >::trace()
  213. << common::TraceElement < MyTime >(get_name(), t,
  214. common::START);
  215. common::Trace < MyTime >::trace().flush();
  216. #endif
  217. _phase = WAIT;
  218. return std::numeric_limits < double >::max();
  219. }
  220. typename MyTime::type ta(typename MyTime::type t) const
  221. {
  222. #ifndef WITH_TRACE
  223. (void)t;
  224. #endif
  225. #ifdef WITH_TRACE
  226. common::Trace < MyTime >::trace()
  227. << common::TraceElement < MyTime >(get_name(), t,
  228. common::TA);
  229. common::Trace < MyTime >::trace().flush();
  230. #endif
  231. if (_phase == WAIT) {
  232. return std::numeric_limits < double >::max();
  233. } else {
  234. return 0;
  235. }
  236. }
  237. common::Bag < MyTime > lambda(typename MyTime::type t) const
  238. {
  239. #ifndef WITH_TRACE
  240. (void)t;
  241. #endif
  242. common::Bag < MyTime > msgs;
  243. msgs.push_back(common::ExternalEvent < MyTime >("out", t));
  244. #ifdef WITH_TRACE
  245. common::Trace < MyTime >::trace()
  246. << common::TraceElement < MyTime >(get_name(), t,
  247. common::LAMBDA)
  248. << "messages = " << msgs.to_string();
  249. common::Trace < MyTime >::trace().flush();
  250. #endif
  251. return msgs;
  252. }
  253. private:
  254. enum Phase { WAIT, SEND };
  255. Phase _phase;
  256. };
  257. class A2 : public paradevs::dtss::Dynamics < MyTime >
  258. {
  259. public:
  260. A2(const std::string& name) : paradevs::dtss::Dynamics < MyTime >(name)
  261. { }
  262. virtual ~A2()
  263. { }
  264. void transition(const common::Bag < MyTime >& x, typename MyTime::type t)
  265. {
  266. #ifndef WITH_TRACE
  267. (void)x;
  268. (void)t;
  269. #endif
  270. #ifdef WITH_TRACE
  271. common::Trace < MyTime >::trace()
  272. << common::TraceElement < MyTime >(get_name(), t,
  273. common::DELTA_INT)
  274. << "x = " << x.to_string();
  275. common::Trace < MyTime >::trace().flush();
  276. #endif
  277. }
  278. typename MyTime::type start(typename MyTime::type t)
  279. {
  280. #ifndef WITH_TRACE
  281. (void)t;
  282. #endif
  283. #ifdef WITH_TRACE
  284. common::Trace < MyTime >::trace()
  285. << common::TraceElement < MyTime >(get_name(), t,
  286. common::START);
  287. common::Trace < MyTime >::trace().flush();
  288. #endif
  289. return 0;
  290. }
  291. common::Bag < MyTime > lambda(typename MyTime::type t) const
  292. {
  293. #ifndef WITH_TRACE
  294. (void)t;
  295. #endif
  296. common::Bag < MyTime > msgs;
  297. msgs.push_back(common::ExternalEvent < MyTime >("out", 0.));
  298. #ifdef WITH_TRACE
  299. common::Trace < MyTime >::trace()
  300. << common::TraceElement < MyTime >(get_name(), t,
  301. common::LAMBDA)
  302. << "messages = " << msgs.to_string();
  303. common::Trace < MyTime >::trace().flush();
  304. #endif
  305. return msgs;
  306. }
  307. };
  308. class B2 : public paradevs::dtss::Dynamics < MyTime >
  309. {
  310. public:
  311. B2(const std::string& name) : paradevs::dtss::Dynamics < MyTime >(name)
  312. { }
  313. virtual ~B2()
  314. { }
  315. void transition(const common::Bag < MyTime >& x, typename MyTime::type t)
  316. {
  317. #ifndef WITH_TRACE
  318. (void)x;
  319. (void)t;
  320. #endif
  321. #ifdef WITH_TRACE
  322. common::Trace < MyTime >::trace()
  323. << common::TraceElement < MyTime >(get_name(), t,
  324. common::DELTA_INT)
  325. << "x = " << x.to_string();
  326. common::Trace < MyTime >::trace().flush();
  327. #endif
  328. }
  329. typename MyTime::type start(typename MyTime::type t)
  330. {
  331. #ifndef WITH_TRACE
  332. (void)t;
  333. #endif
  334. #ifdef WITH_TRACE
  335. common::Trace < MyTime >::trace()
  336. << common::TraceElement < MyTime >(get_name(), t,
  337. common::START);
  338. common::Trace < MyTime >::trace().flush();
  339. #endif
  340. return 0;
  341. }
  342. common::Bag < MyTime > lambda(typename MyTime::type t) const
  343. {
  344. #ifndef WITH_TRACE
  345. (void)t;
  346. #endif
  347. common::Bag < MyTime > msgs;
  348. msgs.push_back(common::ExternalEvent < MyTime >("out", 0.));
  349. #ifdef WITH_TRACE
  350. common::Trace < MyTime >::trace()
  351. << common::TraceElement < MyTime >(get_name(), t,
  352. common::LAMBDA)
  353. << "messages = " << msgs.to_string();
  354. common::Trace < MyTime >::trace().flush();
  355. #endif
  356. return msgs;
  357. }
  358. };
  359. class Beep : public paradevs::pdevs::Dynamics < MyTime >
  360. {
  361. public:
  362. Beep(const std::string& name) : paradevs::pdevs::Dynamics < MyTime >(name)
  363. { }
  364. virtual ~Beep()
  365. { }
  366. void dint(typename MyTime::type t)
  367. {
  368. #ifndef WITH_TRACE
  369. (void)t;
  370. #endif
  371. #ifdef WITH_TRACE
  372. common::Trace < MyTime >::trace() <<
  373. common::TraceElement < MyTime >(get_name(), t,
  374. common::DELTA_INT);
  375. common::Trace < MyTime >::trace().flush();
  376. #endif
  377. if (_phase == SEND) {
  378. _phase = WAIT;
  379. }
  380. }
  381. void dext(typename MyTime::type t, typename MyTime::type /* e */,
  382. const common::Bag < MyTime >& msgs)
  383. {
  384. #ifndef WITH_TRACE
  385. (void)t;
  386. (void)msgs;
  387. #endif
  388. #ifdef WITH_TRACE
  389. common::Trace < MyTime >::trace()
  390. << common::TraceElement < MyTime >(get_name(), t,
  391. common::DELTA_EXT)
  392. << "messages = " << msgs.to_string();
  393. common::Trace < MyTime >::trace().flush();
  394. #endif
  395. _phase = SEND;
  396. }
  397. void dconf(typename MyTime::type t, typename MyTime::type /* e */,
  398. const common::Bag < MyTime >& msgs)
  399. {
  400. #ifndef WITH_TRACE
  401. (void)t;
  402. (void)msgs;
  403. #endif
  404. #ifdef WITH_TRACE
  405. common::Trace < MyTime >::trace()
  406. << common::TraceElement < MyTime >(get_name(), t,
  407. common::DELTA_CONF)
  408. << "messages = " << msgs.to_string();
  409. common::Trace < MyTime >::trace().flush();
  410. #endif
  411. }
  412. typename MyTime::type start(typename MyTime::type t)
  413. {
  414. #ifndef WITH_TRACE
  415. (void)t;
  416. #endif
  417. #ifdef WITH_TRACE
  418. common::Trace < MyTime >::trace()
  419. << common::TraceElement < MyTime >(get_name(), t,
  420. common::START);
  421. common::Trace < MyTime >::trace().flush();
  422. #endif
  423. _phase = WAIT;
  424. return 0;
  425. }
  426. typename MyTime::type ta(typename MyTime::type t) const
  427. {
  428. #ifndef WITH_TRACE
  429. (void)t;
  430. #endif
  431. #ifdef WITH_TRACE
  432. common::Trace < MyTime >::trace()
  433. << common::TraceElement < MyTime >(get_name(), t,
  434. common::TA);
  435. common::Trace < MyTime >::trace().flush();
  436. #endif
  437. if (_phase == WAIT) {
  438. return (rand() % 100) / 10.;
  439. } else {
  440. return 0;
  441. }
  442. }
  443. common::Bag < MyTime > lambda(typename MyTime::type t) const
  444. {
  445. #ifndef WITH_TRACE
  446. (void)t;
  447. #endif
  448. common::Bag < MyTime > msgs;
  449. msgs.push_back(common::ExternalEvent < MyTime >("out", 0.));
  450. #ifdef WITH_TRACE
  451. common::Trace < MyTime >::trace()
  452. << common::TraceElement < MyTime >(get_name(), t,
  453. common::LAMBDA)
  454. << "messages = " << msgs.to_string();
  455. common::Trace < MyTime >::trace().flush();
  456. #endif
  457. return msgs;
  458. }
  459. private:
  460. enum Phase { WAIT, SEND };
  461. Phase _phase;
  462. };
  463. struct LastBagPolicy
  464. {
  465. const common::Bag < MyTime >& bag() const
  466. { return _bag; }
  467. virtual void operator()(typename MyTime::type /* t */,
  468. const common::ExternalEvent < MyTime >& event,
  469. typename MyTime::type /* tl */,
  470. typename MyTime::type /* tn */)
  471. {
  472. _bag.clear();
  473. _bag.push_back(event);
  474. }
  475. private:
  476. common::Bag < MyTime > _bag;
  477. };
  478. struct IgnorePolicy
  479. {
  480. const common::Bag < MyTime >& bag() const
  481. { return _bag; }
  482. virtual void operator()(typename MyTime::type /* t */,
  483. const common::ExternalEvent < MyTime >& /* event */,
  484. typename MyTime::type /* tl */,
  485. typename MyTime::type /* tn */)
  486. { }
  487. private:
  488. common::Bag < MyTime > _bag;
  489. };
  490. class S1GraphManager : public pdevs::GraphManager < MyTime >
  491. {
  492. public:
  493. S1GraphManager(common::Coordinator < MyTime >* coordinator) :
  494. pdevs::GraphManager < MyTime >(coordinator), a("a1"), b("b1")
  495. {
  496. add_child(&a);
  497. add_child(&b);
  498. add_link(&a, "out", &b, "in");
  499. add_link(&b, "out", coordinator, "out");
  500. }
  501. virtual ~S1GraphManager()
  502. { }
  503. private:
  504. pdevs::Simulator < MyTime, A1 > a;
  505. pdevs::Simulator < MyTime, B1 > b;
  506. };
  507. class S2GraphManager : public dtss::GraphManager < MyTime >
  508. {
  509. public:
  510. S2GraphManager(common::Coordinator < MyTime >* coordinator) :
  511. dtss::GraphManager < MyTime >(coordinator), a("a2", 20), b("b2", 20)
  512. {
  513. add_child(&a);
  514. add_child(&b);
  515. add_link(&a, "out", &b, "in");
  516. add_link(coordinator, "in", &a, "in");
  517. }
  518. virtual ~S2GraphManager()
  519. { }
  520. private:
  521. dtss::Simulator < MyTime, A2 > a;
  522. dtss::Simulator < MyTime, B2 > b;
  523. };
  524. class RootGraphManager : public pdevs::GraphManager < MyTime >
  525. {
  526. public:
  527. RootGraphManager(common::Coordinator < MyTime >* coordinator) :
  528. pdevs::GraphManager < MyTime >(coordinator),
  529. S1("S1", paradevs::pdevs::Parameters()),
  530. S2("S2", paradevs::dtss::Parameters < MyTime >(20))
  531. {
  532. add_child(&S1);
  533. add_child(&S2);
  534. add_link(&S1, "out", &S2, "in");
  535. }
  536. virtual ~RootGraphManager()
  537. { }
  538. private:
  539. pdevs::Coordinator < MyTime,
  540. paradevs::common::scheduler::HeapScheduler <
  541. MyTime >,
  542. S1GraphManager > S1;
  543. dtss::Coordinator < MyTime, LastBagPolicy, S2GraphManager > S2;
  544. };
  545. template < int size >
  546. class LinearGraphManager : public pdevs::GraphManager < MyTime >
  547. {
  548. public:
  549. LinearGraphManager(common::Coordinator < MyTime >* coordinator) :
  550. pdevs::GraphManager < MyTime >(coordinator)
  551. {
  552. for (unsigned int i = 1; i <= size; ++i) {
  553. std::ostringstream ss;
  554. ss << "a" << i;
  555. _models.push_back(new pdevs::Simulator < MyTime, Beep >(ss.str()));
  556. }
  557. for (unsigned int i = 0; i < size; ++i) {
  558. add_child(_models[i]);
  559. }
  560. for (unsigned int i = 0; i < size - 1; ++i) {
  561. add_link(_models[i], "out", _models[i + 1], "in");
  562. }
  563. }
  564. virtual ~LinearGraphManager()
  565. {
  566. for (unsigned int i = 0; i < size; ++i) {
  567. delete _models[i];
  568. }
  569. }
  570. private:
  571. std::vector < pdevs::Simulator < MyTime, Beep >* > _models;
  572. };
  573. class Linear2GraphManager : public pdevs::GraphManager < MyTime >
  574. {
  575. public:
  576. Linear2GraphManager(common::Coordinator < MyTime >* coordinator) :
  577. pdevs::GraphManager < MyTime >(coordinator)
  578. {
  579. for (unsigned int i = 1; i <= 100; ++i) {
  580. std::ostringstream ss;
  581. ss << "a" << i;
  582. _models.push_back(new pdevs::Simulator < MyTime, Beep >(ss.str()));
  583. }
  584. for (unsigned int i = 0; i < 100; ++i) {
  585. add_child(_models[i]);
  586. }
  587. for (unsigned int i = 0; i < 99; ++i) {
  588. add_link(_models[i], "out", _models[i + 1], "in");
  589. }
  590. add_link(coordinator, "in", _models[0], "in");
  591. add_link(_models[49], "out", coordinator, "out");
  592. }
  593. virtual ~Linear2GraphManager()
  594. {
  595. for (unsigned int i = 0; i < 100; ++i) {
  596. delete _models[i];
  597. }
  598. }
  599. private:
  600. std::vector < pdevs::Simulator < MyTime, Beep >* > _models;
  601. };
  602. class Root2GraphManager : public pdevs::GraphManager < MyTime >
  603. {
  604. public:
  605. Root2GraphManager(common::Coordinator < MyTime >* coordinator) :
  606. pdevs::GraphManager < MyTime >(coordinator),
  607. S1("S1", paradevs::pdevs::Parameters()),
  608. S2("S2", paradevs::pdevs::Parameters())
  609. {
  610. add_child(&S1);
  611. add_child(&S2);
  612. add_link(&S1, "out", &S2, "in");
  613. }
  614. virtual ~Root2GraphManager()
  615. { }
  616. private:
  617. pdevs::Coordinator < MyTime,
  618. paradevs::common::scheduler::HeapScheduler <
  619. MyTime >,
  620. Linear2GraphManager > S1;
  621. pdevs::Coordinator < MyTime,
  622. paradevs::common::scheduler::HeapScheduler <
  623. MyTime >,
  624. Linear2GraphManager > S2;
  625. };
  626. class Root3GraphManager : public pdevs::GraphManager < MyTime >
  627. {
  628. public:
  629. Root3GraphManager(common::Coordinator < MyTime >* coordinator) :
  630. pdevs::GraphManager < MyTime >(coordinator),
  631. S1("S1", paradevs::pdevs::Parameters()),
  632. S2("S2", paradevs::pdevs::Parameters())
  633. {
  634. add_child(&S1);
  635. add_child(&S2);
  636. // add_link(&S1, "out", &S2, "in");
  637. }
  638. virtual ~Root3GraphManager()
  639. { }
  640. private:
  641. pdevs::Coordinator < MyTime,
  642. paradevs::common::scheduler::VectorScheduler <
  643. MyTime >,
  644. Linear2GraphManager > S1;
  645. pdevs::Coordinator < MyTime,
  646. paradevs::common::scheduler::VectorScheduler <
  647. MyTime >,
  648. Linear2GraphManager > S2;
  649. };
  650. } // namespace paradevs