Greet 2014
Documentation for the GREET 2014 API
 All Classes Namespaces Functions Variables Enumerations Properties Events
Greet.DataStructureV3.Entities.Pathway Class Reference

More...

Inheritance diagram for Greet.DataStructureV3.Entities.Pathway:
Greet.DataStructureV3.Interfaces.IPathway Greet.DataStructureV3.IHaveMetadata Greet.DataStructureV3.Entities.IHaveAPicture Greet.DataStructureV3.Interfaces.IXmlObj

Public Member Functions

 Pathway (int[] existingPathwayIDs)
 
 Pathway (GData data, XmlNode pathwayNode)
 This constructor instantiate all Pathway attributes from the data provided in the XML node More...
 
uint CheckEdge (Edge edge, GData data)
 Check the edge connections at boths ends and see if this is valid or not Returns an error code describing the issue, the error can be checked bit by bit to know see if one or more issues are detected More...
 
KeyValuePair< int, string > CheckPathwayGlobal (GData data)
 Check the properties of a pathway and return error number and human readable sentence to errors if any is detected More...
 
void ClearResults ()
 Clears the results of all the processreference thus clearing the results of the pathway. More...
 
int CompareTo (object obj)
 
int FindOutputDepth (Guid guid)
 Performs a breadth-first search and return the index of the output in the graph representaiton of the pathway More...
 
string FindOutputName (Guid guid, GData data)
 Returns the process name from which one of the allocated outputs is connected to the desired pathway output More...
 
void FromXmlNode (IData data, XmlNode pathwayNode)
 Instantiate all properties of the pathway from the data contained into an XML node More...
 
AOutput getMainOutputFromProcess (GData data)
 
CanonicalOutput getMainOutputResults ()
 
CanonicalOutput getOutputResults (Guid guid)
 Get output results from a Pathway output Guid More...
 
Dictionary< IIO, ResultsGetResults (GData data)
 Returns results for all outputs of this pathway Keys are PathwayOutput.Id members More...
 
Dictionary< IIO, IResultsGetUpstreamResults (IData data)
 Upstream results associated to that pathway More...
 
bool hasCycle ()
 Performs a depth-first search in order to detect cycles in the pathway More...
 
override string ToString ()
 
XmlNode ToXmlNode (XmlDocument xmlDoc)
 
XmlNode ToXmlResultsNode (XmlDocument doc)
 Returns a node containing the results process by process for the pathway More...
 
Boolean Valid (GData data)
 
- Public Member Functions inherited from Greet.DataStructureV3.IHaveResults
Dictionary< IIO, ResultsGetResults (GData data)
 

Static Public Member Functions

static void UpdateVerticesAndEdges (Pathway source, Pathway destination)
 Updates the cloned pathway class member vertices edges and outputs from the pathway returned from the PathwayViewer We only wants to update these specific attributes of the pathway as the pathway viewer does not know anything about name, id and other attributes More...
 

Public Attributes

double _residualEmission = 0
 Residual values between total emissions mass from the lastly calculated iteration. Used to assess convergence of the results More...
 
double _residualResources = 0
 Residual values between total resources energy from the lastly calculated iteration. Used to assess convergence of the results More...
 
FunctionalUnitPreference preferredFunctionalUnit = new FunctionalUnitPreference()
 Prefered functional unit for display More...
 

Properties

Dictionary< Guid,
CanonicalProcess
CanonicalProcesses [get, set]
 The list of processes in that category More...
 
List< IEdgeEdges [get]
 
List< EdgeEdgesData [get, set]
 
FunctionalUnitPreference GetUnitPreference [get]
 Returns display unit preference for this process More...
 
int Id [get, set]
 An id to define the pathway More...
 
DVDict InputsByProcessFuel [get]
 
Guid MainOutput [get, set]
 Returns the output defined as the MainOutput of the pathway, only used for simplification reasons thus the user can choose the patwhay as an upstream and the MainOutput will be automatically selected as an Upstream for this pathway. Saves the user from selecting which of the outputs he desires to use More...
 
int MainOutputResourceID [get]
 Returns the resource ID associated with the main output of the pathway This accessor finds the Output for which the ID match the MainOutput guid and reutrns the resource defined for that output More...
 
string ModifiedBy [get, set]
 
string ModifiedOn [get, set]
 
string Name [get, set]
 The name of the pathway More...
 
string Notes [get, set]
 Some notes associated to that pathway More...
 
List< IIOOutputs [get]
 
List< PMOutputOutputsData [get, set]
 
string PictureName [get, set]
 
List< IProcessReferenceProcesses [get]
 
EmissionAmounts TotalEmissions [get]
 
List< IVertexVertices [get]
 
Dictionary< Guid, VertexVerticesData [get, set]
 
- Properties inherited from Greet.DataStructureV3.Entities.IPathwayForDataGridViewDisplay
int Id [get, set]
 
string Name [get, set]
 
- Properties inherited from Greet.DataStructureV3.Interfaces.IPathway
List< IEdgeEdges [get]
 Edges that represents connections in between the vertices inputs and outputs More...
 
int Id [get, set]
 Unique ID for this pathway among the pathways More...
 
Guid MainOutput [get, set]
 Each pathway must define one main output, especially usefull when the pathway has multiple outputs for the same resource ID This is used for simplification reasons, the user can chose a pathway as an upstream and the main intput will be automatically selected as the upstream associated with that pathway. Thus saving the user from chosing which outputs he desires. More...
 
int MainOutputResourceID [get]
 Returns the resource ID associated with the main output of the pathway. This accessor finds the Output for which the ID match the MainOutput guid and reutrns the resource defined for that output. Returns -1 if the main output cannot be found. More...
 
string Name [get, set]
 Name for this pathway as it is going to show on the graphical interface More...
 
List< IIOOutputs [get]
 
string PictureName [get, set]
 Picture for this pathway as it is going to show on the graphical interface More...
 
List< IProcessReferenceProcesses [get]
 Returns and ordered list of the process IDs used in this pathway More...
 
List< IVertexVertices [get]
 Vertices for that Pathway, vertices can hold a reference to a process, a pathway or a mix More...
 
- Properties inherited from Greet.DataStructureV3.Entities.IHaveAPicture
string PictureName [get, set]
 Get or Set the image name of the object More...
 

Detailed Description

The pathway class stores vertices and edges that are resprectively representing processes and flows

Before the calculations all processes and flows are converted to a canonical format for the calculations as the same process can be reused in multiple pathways with different upstreams.

The pathway also defines output, these outputs will be available for usage outside of the pathway, one of them must be declared MainOutput so the user dosn't need to choose the output everytime he desires to use this pathway as upstream for something

Constructor & Destructor Documentation

Greet.DataStructureV3.Entities.Pathway.Pathway ( int[]  existingPathwayIDs)

This constructor instantiate the name to "New Pathway " + id

It also finds a new ID for the pathway based on the list of existing pathway IDs passed as a parameter

Parameters
existingPathwayIDsExisting pathway IDs to check that we're not creating a new instance with an ID that already exists
Greet.DataStructureV3.Entities.Pathway.Pathway ( GData  data,
XmlNode  pathwayNode 
)

This constructor instantiate all Pathway attributes from the data provided in the XML node

Parameters
dataThe GData object in which the pathway is going to be inserted
pathwayNodeXML node containing the information for the pathway

Member Function Documentation

uint Greet.DataStructureV3.Entities.Pathway.CheckEdge ( Edge  edge,
GData  data 
)

Check the edge connections at boths ends and see if this is valid or not Returns an error code describing the issue, the error can be checked bit by bit to know see if one or more issues are detected

Parameters
edge0 - Everything is fine 1 - Left and Right resources are different 2 - Input vertex does not exists in the pathway 4 - Output vertex does not exists in the pathway 8 - Input Id does not exists in the refered object (probably an issue in the process IOs IDs) 16 - Output Id does not exists in the refered object (output does not exists for pathway, mix, or process?) 32 - Vertex model does not accepts an input from previous therefore cannot be linked with an edge 64 - Input model ID does not exists 128 - Output model ID does not exists 256 - Edge connected to a displaced co-product
Returns
KeyValuePair<int, string> Greet.DataStructureV3.Entities.Pathway.CheckPathwayGlobal ( GData  data)

Check the properties of a pathway and return error number and human readable sentence to errors if any is detected

Parameters
dataThe GData object for other entities references checks
Returns
KeyValuePair containing the number of errors, and a string explaining the detected issues
void Greet.DataStructureV3.Entities.Pathway.ClearResults ( )

Clears the results of all the processreference thus clearing the results of the pathway.

int Greet.DataStructureV3.Entities.Pathway.FindOutputDepth ( Guid  guid)

Performs a breadth-first search and return the index of the output in the graph representaiton of the pathway

Parameters
guidGuid of the output to be searched
Returns
Number of node probed before the output was found
string Greet.DataStructureV3.Entities.Pathway.FindOutputName ( Guid  guid,
GData  data 
)

Returns the process name from which one of the allocated outputs is connected to the desired pathway output

Parameters
guidGuid of the desired pathway output
Returns
Name or exception if the pathway output guid does not exists or if the connection or the vertex is missing
void Greet.DataStructureV3.Entities.Pathway.FromXmlNode ( IData  data,
XmlNode  pathwayNode 
)

Instantiate all properties of the pathway from the data contained into an XML node

Parameters
dataNever actually used in the method but necessary to respect the interface
pathwayNodeThe XML node for the pathway

Implements Greet.DataStructureV3.Interfaces.IXmlObj.

AOutput Greet.DataStructureV3.Entities.Pathway.getMainOutputFromProcess ( GData  data)

Uses the vertices, edges, pathways outptut and pathway main output definition to find the instance of an process model output

The returned reference to instance corresponds to the output of a process model used in this pathway

May throw exceptions if the request cannot be satisfied

Returns
Reference to the instance of an output for a process model
CanonicalOutput Greet.DataStructureV3.Entities.Pathway.getMainOutputResults ( )

Assuming that the vertices that refers to a process have been converted to canonical process result storage instance

Returns an instance of the CanonicalOutput object if the pathway has been converted to canonical processes

May throw exceptions if the request cannot be satisfied

Returns
Results for the outptut defined as the main outptut of the pathway
CanonicalOutput Greet.DataStructureV3.Entities.Pathway.getOutputResults ( Guid  guid)

Get output results from a Pathway output Guid

Parameters
guidGUID of the pathway output
Returns
Canonical output of the process connected to that pathway output
Dictionary<IIO, Results> Greet.DataStructureV3.Entities.Pathway.GetResults ( GData  data)

Returns results for all outputs of this pathway Keys are PathwayOutput.Id members

Parameters
dataData isn't used here and could ignored
Returns
Dictionary where Keys are PathwayOutput.Id and values are Results associated with these outputs
Dictionary<IIO, IResults> Greet.DataStructureV3.Entities.Pathway.GetUpstreamResults ( IData  data)

Upstream results associated to that pathway

This is the prefered way to get the upstream for a product from any pathway. This is equivalent of getting the upstream of the last process in this pathway

Parameters
dataData object needed for references
Returns
Dictionary containing the allocated results for each output of pathway

Implements Greet.DataStructureV3.Interfaces.IPathway.

bool Greet.DataStructureV3.Entities.Pathway.hasCycle ( )

Performs a depth-first search in order to detect cycles in the pathway

Returns
XmlNode Greet.DataStructureV3.Entities.Pathway.ToXmlResultsNode ( XmlDocument  doc)

Returns a node containing the results process by process for the pathway

Parameters
docThe XmlDocument for Namespace URI
Returns
The XML node containin results data for this pathway
static void Greet.DataStructureV3.Entities.Pathway.UpdateVerticesAndEdges ( Pathway  source,
Pathway  destination 
)
static

Updates the cloned pathway class member vertices edges and outputs from the pathway returned from the PathwayViewer We only wants to update these specific attributes of the pathway as the pathway viewer does not know anything about name, id and other attributes

Parameters
sourceThe instance that will serve to update (source)
destinationThe instance that will be updated (destination)

Member Data Documentation

double Greet.DataStructureV3.Entities.Pathway._residualEmission = 0

Residual values between total emissions mass from the lastly calculated iteration. Used to assess convergence of the results

double Greet.DataStructureV3.Entities.Pathway._residualResources = 0

Residual values between total resources energy from the lastly calculated iteration. Used to assess convergence of the results

FunctionalUnitPreference Greet.DataStructureV3.Entities.Pathway.preferredFunctionalUnit = new FunctionalUnitPreference()

Prefered functional unit for display

Property Documentation

Dictionary<Guid, CanonicalProcess> Greet.DataStructureV3.Entities.Pathway.CanonicalProcesses
getset

The list of processes in that category

FunctionalUnitPreference Greet.DataStructureV3.Entities.Pathway.GetUnitPreference
get

Returns display unit preference for this process

int Greet.DataStructureV3.Entities.Pathway.Id
getset

An id to define the pathway

Guid Greet.DataStructureV3.Entities.Pathway.MainOutput
getset

Returns the output defined as the MainOutput of the pathway, only used for simplification reasons thus the user can choose the patwhay as an upstream and the MainOutput will be automatically selected as an Upstream for this pathway. Saves the user from selecting which of the outputs he desires to use

int Greet.DataStructureV3.Entities.Pathway.MainOutputResourceID
get

Returns the resource ID associated with the main output of the pathway This accessor finds the Output for which the ID match the MainOutput guid and reutrns the resource defined for that output

string Greet.DataStructureV3.Entities.Pathway.Name
getset

The name of the pathway

string Greet.DataStructureV3.Entities.Pathway.Notes
getset

Some notes associated to that pathway

List<IIO> Greet.DataStructureV3.Entities.Pathway.Outputs
get

Lists outputs that are proper to the pathway

This are not the outputs of the processes. The output of the processes are linked to these outputs using Edges but are not the same instances


The documentation for this class was generated from the following file: