|
@@ -56,10 +56,6 @@ namespace artis {
|
|
|
class Parabola
|
|
|
: public artis::pdevs::qss::Derivative<common::DoubleTime, Parabola, ParabolaParameters> {
|
|
|
public:
|
|
|
- enum states {
|
|
|
- X = LAST_OUTPUT + 1
|
|
|
- };
|
|
|
-
|
|
|
Parabola(const std::string& name,
|
|
|
const artis::pdevs::Context<common::DoubleTime, Parabola, ParabolaParameters>& context)
|
|
|
:
|
|
@@ -67,7 +63,7 @@ namespace artis {
|
|
|
name,
|
|
|
context), _alpha(context.parameters().alpha)
|
|
|
{
|
|
|
- DECLARE_STATES(double, ((X, &Parabola::_x)));
|
|
|
+ internal("X", &Parabola::_x);
|
|
|
}
|
|
|
|
|
|
~Parabola() override = default;
|
|
@@ -90,13 +86,7 @@ namespace artis {
|
|
|
class Predator
|
|
|
: public artis::pdevs::qss::Derivative<common::DoubleTime, Predator, PreyPredatorParameters> {
|
|
|
public:
|
|
|
- enum inputs {
|
|
|
- IN_X = IN + 1
|
|
|
- };
|
|
|
-
|
|
|
- enum states {
|
|
|
- Y = LAST_OUTPUT + 1, X
|
|
|
- };
|
|
|
+ unsigned int IN_X;
|
|
|
|
|
|
Predator(const std::string& name,
|
|
|
const artis::pdevs::Context<common::DoubleTime, Predator, PreyPredatorParameters>& context)
|
|
@@ -106,9 +96,8 @@ namespace artis {
|
|
|
context), _b(context.parameters().b), _d(context.parameters().d),
|
|
|
_e(context.parameters().e)
|
|
|
{
|
|
|
- DECLARE_STATES(double, ((X, &Predator::_x), (Y, &Predator::_y)));
|
|
|
-
|
|
|
- input_port({IN_X, "in_x"});
|
|
|
+ internal("Y", &Predator::_y);
|
|
|
+ IN_X = external("X", &Predator::_x);
|
|
|
}
|
|
|
|
|
|
~Predator() override = default;
|
|
@@ -129,13 +118,7 @@ namespace artis {
|
|
|
class Prey
|
|
|
: public artis::pdevs::qss::Derivative<common::DoubleTime, Prey, PreyPredatorParameters> {
|
|
|
public:
|
|
|
- enum inputs {
|
|
|
- IN_Y = IN + 1
|
|
|
- };
|
|
|
-
|
|
|
- enum states {
|
|
|
- X = LAST_OUTPUT + 1, Y
|
|
|
- };
|
|
|
+ unsigned int IN_Y;
|
|
|
|
|
|
Prey(const std::string& name,
|
|
|
const artis::pdevs::Context<common::DoubleTime, Prey, PreyPredatorParameters>& context)
|
|
@@ -144,9 +127,8 @@ namespace artis {
|
|
|
name,
|
|
|
context), _a(context.parameters().a), _b(context.parameters().b)
|
|
|
{
|
|
|
- DECLARE_STATES(double, ((X, &Prey::_x), (Y, &Prey::_y)));
|
|
|
-
|
|
|
- input_port({IN_Y, "in_y"});
|
|
|
+ internal("X", &Prey::_x);
|
|
|
+ IN_Y = external("Y", &Prey::_y);
|
|
|
}
|
|
|
|
|
|
~Prey() override = default;
|