1#ifndef BPMNOS_Model_Scenario_H
2#define BPMNOS_Model_Scenario_H
6#include <unordered_map>
15typedef std::unordered_map< const BPMN::Process*, std::unordered_map< std::string, const Attribute* > >
DataInput;
24 std::optional<BPMNOS::number>
value;
36 std::unordered_map< const Attribute*, Data >
data;
Represents a BPMN model with all its processes.
The Scenario class holds data for all BPMN instances.
BPMNOS::number inception
Time earliest time in execution.
std::vector< std::tuple< const BPMN::Process *, BPMNOS::Values, BPMNOS::Values > > getCurrentInstantiations(const BPMNOS::number currentTime) const
Method returning a vector of all instances that are known to be instantiated at the given time.
Values getKnownInitialStatus(const InstanceData *, const BPMNOS::number time) const
Method returning the initial status of a known instantiation at the given time.
Values getKnownInitialData(const InstanceData *, const BPMNOS::number time) const
Method returning the initial data attributes of a known instantiation at the given time.
virtual void update()
Virtual method allowing derived scenarios to update their data.
std::optional< BPMNOS::number > getAnticipatedValue(const Scenario::InstanceData *instance, const BPMNOS::Model::Attribute *attribute, const BPMNOS::number currentTime) const
Method returning disclosed value of an attribute.
std::vector< const InstanceData * > getCreatedInstances(const BPMNOS::number currentTime) const
Method returning a vector of all instances that have been created until the given time.
std::optional< BPMNOS::Values > getKnownData(const BPMNOS::number instanceId, const BPMN::Node *node, const BPMNOS::number currentTime) const
Method returning all known values of new attributes.
Data & getAttributeData(const BPMNOS::number instanceId, const Attribute *attribute)
static constexpr char delimiters[]
Delimiters used for disambiguation of identifiers of non-interrupting event subprocesses and multi-in...
const DataInput & attributes
Map holding all attributes in the model with keys being the process and attribute id.
BPMNOS::number completion
The latest time in execution at which an instantiation can happen.
const Scenario::Disclosure & getLatestDisclosure(const std::vector< Scenario::Disclosure > &data, const BPMNOS::number currentTime) const
bool isCompleted(const BPMNOS::number currentTime) const
Method returning true if the currentTime exceeds the completion time.
std::unordered_map< size_t, InstanceData > instances
Map of instances with key being the instance id.
BPMNOS::Values getAnticipatedInitialStatus(const InstanceData *, const BPMNOS::number currentTime) const
Method returning the initial status of an anticipated instantiation at the given time.
void setRealization(Data &data, Disclosure realization)
const Model * getModel() const
void updateCompletion(const BPMNOS::number time)
Method updating the completion time.
Scenario(const Model *model, BPMNOS::number inception, BPMNOS::number completion, const DataInput &attributes, const std::unordered_map< const Attribute *, BPMNOS::number > &globalValueMap, unsigned int index=0)
Constructor for Scenario.
void removeAnticipatedInstance(const BPMNOS::number instanceId)
std::optional< BPMNOS::Values > getKnownValues(const BPMNOS::number instanceId, const BPMN::Node *node, const BPMNOS::number currentTime) const
Method returning all known values of new attributes.
void addAnticipation(Data &data, Disclosure anticipation)
Data & getInstantiationData(const BPMNOS::number instanceId)
void addInstance(const BPMN::Process *process, const BPMNOS::number instanceId, Data instantiation)
std::vector< const InstanceData * > getAnticipatedInstances(const BPMNOS::number currentTime) const
Method returning a vector of all instances that are anticipated and not known for sure at the given t...
std::vector< const InstanceData * > getKnownInstances(const BPMNOS::number currentTime) const
Method returning a vector of all instances that have been created or are known for sure until the giv...
std::vector< std::tuple< const BPMN::Process *, BPMNOS::Values, BPMNOS::Values > > getAnticipatedInstantiations(const BPMNOS::number currentTime, const BPMNOS::number assumedTime) const
Method returning a vector of all instances that are anticipated to be instantiated at the assumed tim...
BPMNOS::Values getAnticipatedInitialData(const InstanceData *, const BPMNOS::number currentTime) const
Method returning the initial data attributes of an anticipated instantiation at the given time.
BPMNOS::Values getAnticipatedData(const BPMNOS::number instanceId, const BPMN::Node *node, const BPMNOS::number currentTime) const
Method returning the disclosed values of new attributes.
std::optional< BPMNOS::number > getKnownValue(const Scenario::InstanceData *instance, const BPMNOS::Model::Attribute *attribute, const BPMNOS::number currentTime) const
Method returning a known value of an attribute.
BPMNOS::Values getAnticipatedValues(const BPMNOS::number instanceId, const BPMN::Node *node, const BPMNOS::number currentTime) const
Method returning the disclosed values of new attributes.
const Model * model
Pointer to the BPMN model.
BPMNOS::number getInception() const
Method returning the time of the earliest instantiation.
Base class for all nodes in a BPMN model.
std::unordered_map< const BPMN::Process *, std::unordered_map< std::string, const Attribute * > > DataInput
BPMNOS_NUMBER_TYPE number
std::optional< Disclosure > realization
std::vector< Disclosure > anticipations
BPMNOS::number disclosure
Time at which the value is disclosed.
std::optional< BPMNOS::number > value
Value that the attribute takes at the time of disclosed.
std::unordered_map< const Attribute *, Data > data
Data regarding attribute values.
const BPMN::Process * process
size_t id
Instance identifier.
Data instantiation
Data regarding the time of instantiation.