|
@@ -36,7 +36,8 @@ namespace artis {
|
|
namespace qss {
|
|
namespace qss {
|
|
|
|
|
|
template<class DerivativeParameters>
|
|
template<class DerivativeParameters>
|
|
-struct QSSParameters {
|
|
|
|
|
|
+struct QSSParameters
|
|
|
|
+{
|
|
artis::qss::IntegratorParameters integrator;
|
|
artis::qss::IntegratorParameters integrator;
|
|
artis::qss::QuantifierParameters quantifier;
|
|
artis::qss::QuantifierParameters quantifier;
|
|
DerivativeParameters derivative;
|
|
DerivativeParameters derivative;
|
|
@@ -48,18 +49,31 @@ template<class Time,
|
|
class GraphManager :
|
|
class GraphManager :
|
|
public artis::pdevs::GraphManager<Time,
|
|
public artis::pdevs::GraphManager<Time,
|
|
QSSParameters<DerivativeParameters>,
|
|
QSSParameters<DerivativeParameters>,
|
|
- artis::common::NoParameters> {
|
|
|
|
|
|
+ artis::common::NoParameters>
|
|
|
|
+{
|
|
public:
|
|
public:
|
|
- enum submodels {
|
|
|
|
- S_Derivative, S_Integrator, S_Quantifier
|
|
|
|
|
|
+ struct submodel
|
|
|
|
+ {
|
|
|
|
+ enum values
|
|
|
|
+ {
|
|
|
|
+ S_Derivative, S_Integrator, S_Quantifier
|
|
|
|
+ };
|
|
};
|
|
};
|
|
|
|
|
|
- enum inputs {
|
|
|
|
- RESET
|
|
|
|
|
|
+ struct input
|
|
|
|
+ {
|
|
|
|
+ enum values
|
|
|
|
+ {
|
|
|
|
+ RESET
|
|
|
|
+ };
|
|
};
|
|
};
|
|
|
|
|
|
- enum outputs {
|
|
|
|
- OUT
|
|
|
|
|
|
+ struct output
|
|
|
|
+ {
|
|
|
|
+ enum values
|
|
|
|
+ {
|
|
|
|
+ OUT
|
|
|
|
+ };
|
|
};
|
|
};
|
|
|
|
|
|
GraphManager(common::Coordinator <Time> *coordinator,
|
|
GraphManager(common::Coordinator <Time> *coordinator,
|
|
@@ -75,37 +89,39 @@ public:
|
|
),
|
|
),
|
|
_derivative("d", parameters.derivative),
|
|
_derivative("d", parameters.derivative),
|
|
_integrator("i", parameters.integrator),
|
|
_integrator("i", parameters.integrator),
|
|
- _quantifier("q", parameters.quantifier) {
|
|
|
|
- this->add_child(S_Derivative, &_derivative);
|
|
|
|
- this->add_child(S_Integrator, &_integrator);
|
|
|
|
- this->add_child(S_Quantifier, &_quantifier);
|
|
|
|
-
|
|
|
|
- coordinator->input_port({RESET, "reset"});
|
|
|
|
- coordinator->output_port({OUT, "out"});
|
|
|
|
-
|
|
|
|
- this->in({coordinator, RESET})
|
|
|
|
- >> this->in({&_derivative, Derivative::RESET});
|
|
|
|
- this->in({coordinator, RESET})
|
|
|
|
- >> this->in({&_integrator, Integrator<Time>::RESET});
|
|
|
|
- this->in({coordinator, RESET})
|
|
|
|
- >> this->in({&_quantifier, Quantifier<Time>::RESET});
|
|
|
|
-
|
|
|
|
- this->out({&_derivative, Derivative::OUT})
|
|
|
|
- >> this->in({&_integrator, Integrator<Time>::X_DOT});
|
|
|
|
- this->out({&_integrator, Integrator<Time>::OUT})
|
|
|
|
- >> this->in({&_quantifier, Quantifier<Time>::IN});
|
|
|
|
- this->out({&_quantifier, Quantifier<Time>::OUT})
|
|
|
|
- >> this->in({&_integrator, Integrator<Time>::QUANTA});
|
|
|
|
- this->out({&_integrator, Integrator<Time>::OUT})
|
|
|
|
- >> this->out({coordinator, OUT});
|
|
|
|
- this->out({&_integrator, Integrator<Time>::OUT})
|
|
|
|
- >> this->in({&_derivative, Derivative::IN});
|
|
|
|
|
|
+ _quantifier("q", parameters.quantifier)
|
|
|
|
+ {
|
|
|
|
+ this->add_child(submodel::S_Derivative, &_derivative);
|
|
|
|
+ this->add_child(submodel::S_Integrator, &_integrator);
|
|
|
|
+ this->add_child(submodel::S_Quantifier, &_quantifier);
|
|
|
|
+
|
|
|
|
+ coordinator->input_port({input::RESET, "reset"});
|
|
|
|
+ coordinator->output_port({output::OUT, "out"});
|
|
|
|
+
|
|
|
|
+ this->in({coordinator, input::RESET})
|
|
|
|
+ >> this->in({&_derivative, Derivative::input::RESET});
|
|
|
|
+ this->in({coordinator, input::RESET})
|
|
|
|
+ >> this->in({&_integrator, Integrator<Time>::input::RESET});
|
|
|
|
+ this->in({coordinator, input::RESET})
|
|
|
|
+ >> this->in({&_quantifier, Quantifier<Time>::input::RESET});
|
|
|
|
+
|
|
|
|
+ this->out({&_derivative, Derivative::output::OUT})
|
|
|
|
+ >> this->in({&_integrator, Integrator<Time>::input::X_DOT});
|
|
|
|
+ this->out({&_integrator, Integrator<Time>::output::OUT})
|
|
|
|
+ >> this->in({&_quantifier, Quantifier<Time>::input::IN});
|
|
|
|
+ this->out({&_quantifier, Quantifier<Time>::output::OUT})
|
|
|
|
+ >> this->in({&_integrator, Integrator<Time>::input::QUANTA});
|
|
|
|
+ this->out({&_integrator, Integrator<Time>::output::OUT})
|
|
|
|
+ >> this->out({coordinator, output::OUT});
|
|
|
|
+ this->out({&_integrator, Integrator<Time>::output::OUT})
|
|
|
|
+ >> this->in({&_derivative, Derivative::input::IN});
|
|
}
|
|
}
|
|
|
|
|
|
~GraphManager() override = default;
|
|
~GraphManager() override = default;
|
|
|
|
|
|
artis::pdevs::Simulator<Time, Derivative, DerivativeParameters> *
|
|
artis::pdevs::Simulator<Time, Derivative, DerivativeParameters> *
|
|
- derivative() { return &_derivative; }
|
|
|
|
|
|
+ derivative()
|
|
|
|
+ { return &_derivative; }
|
|
|
|
|
|
private:
|
|
private:
|
|
artis::pdevs::Simulator<Time, Derivative, DerivativeParameters> _derivative;
|
|
artis::pdevs::Simulator<Time, Derivative, DerivativeParameters> _derivative;
|