3using System.Threading.Tasks;
16 private readonly
Model model;
72 public abstract Task
FromXml(XmlElement Definition);
89 return Task.CompletedTask;
97 return Task.CompletedTask;
105 return Task.CompletedTask;
114 return Task.CompletedTask;
123 return Task.CompletedTask;
131 protected static void Indent(StreamWriter Output,
int Indentation)
134 Output.Write(
new string(
'\t', Indentation));
150 Result = v.ValueObject;
157 if (this.lastActorExpression is
null || ActorStr != this.lastActor)
159 this.lastActorExpression =
new Expression(ActorStr);
160 this.lastActor = ActorStr;
163 Exp = this.lastActorExpression;
169 if (Result is
Actor Actor2)
170 return Actor2.ActivityObject;
187 throw new Exception(
"Expected an actor: " +
Actor);
190 private string lastActor =
null;
191 private Expression lastActorExpression =
null;
192 private readonly
object synchObj =
new object();
Root node of a simulation model
const string ComSimNamespace
http://lab.tagroot.io/Schema/ComSim.xsd
Abstract base class for actors
Abstract base class for simulation nodes
SimulationNode(ISimulationNode Parent, Model Model)
Abstract base class for simulation nodes
async Task< object > GetActorObjectAsync(StringAttribute Actor, Variables Variables)
Gets an actor object, given a string representation, possibly containing script, of the actor.
virtual Task Finalize()
Finalizes the node after simulation.
static void Indent(StreamWriter Output, int Indentation)
Adds indentation to the current row.
ISimulationNode Parent
Parent node in the simulation model.
abstract string LocalName
Local name of XML element defining contents of class.
Model Model
Model in which the node is defined.
virtual Task ForEach(ForEachCallbackMethod Method, bool DepthFirst)
Evaluates Method on each node in the subtree defined by the current node.
virtual Task Initialize()
Initialized the node before simulation.
virtual Task ExportXml(XmlWriter Output)
Exports XML
virtual string SchemaResource
Points to the embedded XML Schema resource defining the semantics of the XML namespace.
async Task< IActor > GetActorAsync(StringAttribute Actor, Variables Variables)
Gets an actor, given a string representation, possibly containing script, of the actor.
virtual Task ExportMarkdown(StreamWriter Output)
Exports Markdown
abstract ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
abstract Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
virtual Task Start()
Starts the node.
virtual string Namespace
XML Namespace where the element is defined.
Contains the value of a string attribute, possibly with embedded script.
Class managing a script expression.
async Task< object > EvaluateAsync(Variables Variables)
Evaluates the expression, using the variables provided in the Variables collection....
Contains information about a variable.
virtual bool TryGetVariable(string Name, out Variable Variable)
Tries to get a variable object, given its name.
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
delegate Task ForEachCallbackMethod(ISimulationNode Node)
Callback method for iteration across the simulation model.