models.hpp 2.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. /**
  2. * @file tests/multithreading/lifegame/models.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. #ifndef TESTS_MULTITHREADING_LIFEGAME_MODELS_HPP
  26. #define TESTS_MULTITHREADING_LIFEGAME_MODELS_HPP 1
  27. #include <paradevs/common/time/DoubleTime.hpp>
  28. #include <paradevs/kernel/pdevs/Dynamics.hpp>
  29. namespace paradevs { namespace tests {
  30. namespace multithreading { namespace lifegame {
  31. template < class SchedulerHandle>
  32. class Cell :
  33. public paradevs::pdevs::Dynamics < common::DoubleTime, SchedulerHandle >
  34. {
  35. public:
  36. Cell(const std::string& name, const common::NoParameters& parameters) :
  37. paradevs::pdevs::Dynamics < common::DoubleTime,
  38. SchedulerHandle >(name, parameters)
  39. { }
  40. virtual ~Cell()
  41. { }
  42. void dint(typename common::DoubleTime::type t)
  43. {
  44. }
  45. void dext(typename common::DoubleTime::type t,
  46. typename common::DoubleTime::type /* e */,
  47. const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
  48. {
  49. }
  50. void dconf(typename common::DoubleTime::type t,
  51. typename common::DoubleTime::type /* e */,
  52. const common::Bag < common::DoubleTime, SchedulerHandle >& msgs)
  53. {
  54. }
  55. typename common::DoubleTime::type start(typename common::DoubleTime::type t)
  56. {
  57. return 0;
  58. }
  59. typename common::DoubleTime::type ta(
  60. typename common::DoubleTime::type t) const
  61. {
  62. }
  63. common::Bag < common::DoubleTime, SchedulerHandle > lambda(
  64. typename common::DoubleTime::type t) const
  65. {
  66. common::Bag < common::DoubleTime, SchedulerHandle > msgs;
  67. return msgs;
  68. }
  69. void observation(std::ostream& /* file */) const
  70. { }
  71. private:
  72. enum Phase { INIT, IDLE, NEWSTATE };
  73. Phase _phase;
  74. };
  75. } } } } // namespace paradevs tests multithreading lifegame
  76. #endif