Class ConnectionParser
- Namespace
- TimeSeriesAnalysis.Dynamic
- Assembly
- TimeSeriesAnalysis.dll
Class that tracks which model is connected to which in a set of models.
This is important when traversing the models when simulating with the PlantSimulator, as these models need to be run in a specific order
public class ConnectionParser
- Inheritance
-
ConnectionParser
- Inherited Members
Constructors
ConnectionParser()
Constructor
public ConnectionParser()
Fields
connections
List of connections
[JsonInclude]
public List<(string, string)> connections
Field Value
Methods
FindComputationalLoops(Dictionary<string, ISimulatableModel>)
Parses models and determines if there are co-dependent models
public Dictionary<string, List<string>> FindComputationalLoops(Dictionary<string, ISimulatableModel> modelDict)
Parameters
modelDictDictionary<string, ISimulatableModel>
Returns
- Dictionary<string, List<string>>
a dictionary with an ID and a list of all involved modelIDs
GetAllDownstreamModelIDs(string)
Get all the models which are connected to a given model one level directly downstream of it
public List<string> GetAllDownstreamModelIDs(string modelID)
Parameters
modelIDstring
Returns
GetAllUpstreamModels(string)
Get all the models which are connected to a given model one level directly upstream of it
public List<string> GetAllUpstreamModels(string modelID)
Parameters
modelIDstring
Returns
GetUnitModelControlledByPID(string, Dictionary<string, ISimulatableModel>)
Get unit model controlled by PDI
public string GetUnitModelControlledByPID(string pidModelID, Dictionary<string, ISimulatableModel> modelDict)
Parameters
pidModelIDstringmodelDictDictionary<string, ISimulatableModel>
Returns
- string
returns null if no model is found
GetUpstreamPIDIds(string, Dictionary<string, ISimulatableModel>)
Get the ID of the PID-controller that is upstream a given modelID
public string[] GetUpstreamPIDIds(string modelID, Dictionary<string, ISimulatableModel> modelDict)
Parameters
modelIDstringmodelDictDictionary<string, ISimulatableModel>
Returns
- string[]
HasUpstreamPID(string, Dictionary<string, ISimulatableModel>)
Query if the model has an upstream PID-model.
public bool HasUpstreamPID(string modelID, Dictionary<string, ISimulatableModel> modelDict)
Parameters
modelIDstringmodelDictDictionary<string, ISimulatableModel>
Returns
InitAndDetermineCalculationOrderOfModels(Dictionary<string, ISimulatableModel>)
Determine the order in which the models must be solved
public (List<string>, Dictionary<string, List<string>>) InitAndDetermineCalculationOrderOfModels(Dictionary<string, ISimulatableModel> modelDict)
Parameters
modelDictDictionary<string, ISimulatableModel>