Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
CounterActivityNode.cs
1using System;
2using System.Threading.Tasks;
3using System.Xml;
5using Waher.Script;
6
8{
12 public abstract class CounterActivityNode : ActivityNode
13 {
18
25 : base(Parent, Model)
26 {
27 }
28
32 public Task<string> GetCounterAsync(Variables Variables)
33 {
34 return this.counter.GetValueAsync(Variables);
35 }
36
41 public override Task FromXml(XmlElement Definition)
42 {
43 this.counter = new StringAttribute(XML.Attribute(Definition, "counter"));
44
45 return Task.CompletedTask;
46 }
47
48 }
49}
Root node of a simulation model
Definition: Model.cs:49
Abstract base class for activity nodes
Definition: ActivityNode.cs:15
Abstract base class for counter activity nodes.
Task< string > GetCounterAsync(Variables Variables)
Counter name
CounterActivityNode(ISimulationNode Parent, Model Model)
Abstract base class for counter activity nodes.
override Task FromXml(XmlElement Definition)
Sets properties and attributes of class in accordance with XML definition.
Contains the value of a string attribute, possibly with embedded script.
async Task< string > GetValueAsync(Variables Variables)
Gets the value of the attribute.
Helps with common XML-related tasks.
Definition: XML.cs:19
static string Attribute(XmlElement E, string Name)
Gets the value of an XML attribute.
Definition: XML.cs:914
Collection of variables.
Definition: Variables.cs:25
Basic interface for simulator nodes. Implementing this interface allows classes with default contruct...
ISimulationNode Parent
Parent node in the simulation model.