Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
Dec.cs
1using System;
2using System.Collections.Generic;
3using System.IO;
4using System.Threading.Tasks;
5using Waher.Script;
6
8{
12 public class Dec : CounterActivityNode
13 {
20 : base(Parent, Model)
21 {
22 }
23
27 public override string LocalName => nameof(Dec);
28
36 {
37 return new Dec(Parent, Model);
38 }
39
45 public override async Task<LinkedListNode<IActivityNode>> Execute(Variables Variables)
46 {
47 this.Model.DecrementCounter(await this.GetCounterAsync(Variables));
48 return null;
49 }
50
57 public override void ExportPlantUml(StreamWriter Output, int Indentation, char QuoteChar)
58 {
59 Indent(Output, Indentation);
60 Output.Write(":Dec(");
61 Output.Write(this.counter.Value);
62 Output.WriteLine(");");
63 }
64 }
65}
Root node of a simulation model
Definition: Model.cs:49
void DecrementCounter(string CounterName)
Decrements a counter.
Definition: Model.cs:1003
Abstract base class for counter activity nodes.
Task< string > GetCounterAsync(Variables Variables)
Counter name
Decrements a counter.
Definition: Dec.cs:13
Dec(ISimulationNode Parent, Model Model)
Decrements a counter.
Definition: Dec.cs:19
override async Task< LinkedListNode< IActivityNode > > Execute(Variables Variables)
Executes a node.
Definition: Dec.cs:45
override string LocalName
Local name of XML element defining contents of class.
Definition: Dec.cs:27
override void ExportPlantUml(StreamWriter Output, int Indentation, char QuoteChar)
Exports PlantUML
Definition: Dec.cs:57
override ISimulationNode Create(ISimulationNode Parent, Model Model)
Creates a new instance of the node.
Definition: Dec.cs:35
static void Indent(StreamWriter Output, int Indentation)
Adds indentation to the current row.
string Value
String value, from definition
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.