17 #ifndef ABSTRACT_MODEL_H 18 #define ABSTRACT_MODEL_H 23 #include "abstractplugin.h" 24 #include "abstractgraph.h" 114 inline const Edge&
edge(
int edgeId)
const;
116 inline const Edge&
edge(
int originId,
int neighbourId)
const;
123 { Q_UNUSED(inputs);
return Values(); }
149 {
return graph()->
edge(originId, neighbourId); }
152 #endif // ABSTRACT_MODEL_H virtual void afterLoop()=0
It is executed after the algorithmStep() loop ends.
AbstractModel()=default
constructor
const Edges & edges() const
Gets the edges.
Definition: abstractgraph.h:236
AbstractGraph * graph() const
Gets the pointer to the current graph.
It wraps a std::shared_ptr<BaseNode>.
Definition: node.h:35
int step() const
Gets the current time step.
virtual Values customOutputs(const Values &inputs) const =0
Allows implementing custom outputs for the model plugin.
Abstract base class for model plugins.
Definition: abstractmodel.h:78
void beforeLoop() override
It is executed before the algorithmStep() loop.
Definition: abstractmodel.h:120
Provides a common interface for Model plugins.
Definition: abstractmodel.h:35
virtual bool algorithmStep()=0
It is executed in a loop and must contain all the logic to perform ONE step.
Values customOutputs(const Values &inputs) const override
Allows implementing custom outputs for the model plugin.
Definition: abstractmodel.h:122
const Nodes & nodes() const
Gets the nodes.
Definition: abstractmodel.h:136
const Edges & edges() const
Gets the edges.
Definition: abstractmodel.h:142
Node node(int nodeId) const
Gets the Node corresponding to nodeId.
Definition: abstractgraph.h:248
A Node container.
Definition: nodes.h:32
void afterLoop() override
It is executed after the algorithmStep() loop ends.
Definition: abstractmodel.h:121
An Edge connects a Node to itself or to another Node.
Definition: edge.h:37
const Edge & edge(int edgeId) const
Returns the Edge corresponding to edgeId.
Definition: abstractgraph.h:242
Node node(int nodeId) const
Gets the Node corresponding to nodeId.
Definition: abstractmodel.h:139
const Edge & edge(int edgeId) const
Returns the Edge corresponding to edgeId.
Definition: abstractmodel.h:145
const QString & graphId() const
Gets the graph id.
Base class for plugins.
Definition: abstractplugin.h:34
virtual ~AbstractModelInterface()=default
Provide a default destructor to keep compilers happy.
int lastStep() const
Gets the end time step (stopAt).
virtual void beforeLoop()=0
It is executed before the algorithmStep() loop.
const Nodes & nodes() const
Gets the nodes.
Definition: abstractgraph.h:239
Definition: abstractgraph.h:29
Abstract base class for graph plugins.
Definition: abstractgraph.h:54
virtual bool init()
Initializes the plugin.
An Edge container.
Definition: edges.h:32