2using System.Collections.Generic;
4using System.Threading.Tasks;
17 private string @event;
33 public string Event => this.@event;
55 public override Task
FromXml(XmlElement Definition)
59 return base.FromXml(Definition);
71 throw new Exception(
"Event " + this.@event +
" not found.");
73 return base.Initialize();
103 public void ExportPlantUml(StreamWriter Output,
int Indentation,
bool First,
char QuoteChar)
105 Indent(Output, Indentation);
108 Output.WriteLine(
"split");
110 Output.WriteLine(
"split again");
113 Indent(Output, Indentation);
115 Output.Write(
"#FireBrick:");
116 Output.Write(this.@event);
117 Output.WriteLine(
"<");
119 base.ExportPlantUml(Output, Indentation + 1, QuoteChar);
Root node of a simulation model
bool TryGetEvent(string Id, out IEvent Event)
Tries to get a registered event from the model.
Represents an activity that can be executed as the result of triggered events.
static async Task ExecuteActivity(Variables Variables, LinkedListNode< IActivityNode > Start)
Executes an activity by executing a possibly branching sequence of nodes.
Abstract base class for activity nodes
LinkedListNode< IActivityNode > FirstNode
First child activity node.
Waits for an event to be triggered
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
override Task Initialize()
Initialized the node before simulation.
override async Task< LinkedListNode< IActivityNode > > Execute(Variables Variables)
Executes a node.
override string LocalName
Local name of XML element defining contents of class.
override Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
Triggered(ISimulationNode Parent, Model Model)
Waits for an event to be triggered
void ExportPlantUml(StreamWriter Output, int Indentation, bool First, char QuoteChar)
Exports PlantUML
Task GetTask()
Gets a task object.
Conditional execution in an activity, based on external events.
void Register(ITriggerNode Node)
Register a trigger node.
Abstract base class for events
static void Indent(StreamWriter Output, int Indentation)
Adds indentation to the current row.
Helps with common XML-related tasks.
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
ISimulationNode Parent
Parent node in the simulation model.
Interface for trigger nodes
Task GetTrigger()
Gets a Task object, that will be completed when the event is triggered.