Greet 2014
Documentation for the GREET 2014 API
|
Public Member Functions | |
DataHelper (GData data) | |
Default construsctor, needs a reference to an instance of a GData object More... | |
void | addInputToBiogenicCarbonMatrix (Dictionary< Guid, Dictionary< Guid, double >> CarbonTransferts, IInput input) |
Tests if a transfer value can be added for that new input (i.e. if we already have some outputs defined) Otherwise do not change anything to the transfert matrix More... | |
void | addInputToBiogenicCarbonMatrix (IProcess process, IIO output) |
IIO | createNewCoProduct (int resourceId, double amount=0, string quantity="joules") |
Creates a new output if the resource ID exists in the database, returns null otherwise More... | |
IInput | createNewInput (int resourceId, double amount=0, string quantity="joules", int source=0) |
Creates a new input if resource ID exists in the database, returns null otherwise More... | |
IIO | createNewMainOutput (int resourceId, double amount=0, string quantity="joules") |
Creates a new output if the resource ID exists in the database, returns null otherwise More... | |
IPathway | createNewPathway (string name="") |
Creates a new instance of a Pathway WITHOUT adding it to the dataset More... | |
IProcess | createNewProcess (int type, string name="") |
Creates a new instance of a process either stationary or transportation More... | |
IResource | createNewResource (string name="") |
Creates a new instance of a resource given a name for that resource More... | |
IMix | DuplicateMix (IMix mix) |
Creates a new instance of a mix with a new ID and new output ID Takes care of registering all parameters and assiging new IDs More... | |
IPathway | DuplicatePathway (IPathway o) |
Creates a copy of a pathway with an identical structure but a whole new set of IDs More... | |
IStationaryProcess | DuplicateStationaryProcess (IStationaryProcess stationaryProcess) |
Creates a copy of a stationary process with an identical structure but new IDs and parameters More... | |
ITransportationProcess | DuplicateTransportationProcess (ITransportationProcess transportationProcess) |
Creates a copy of a transportation process with an identical structure but new IDs and parameters More... | |
bool | insertOrUpdatePathway (IPathway pathway, out string errorMessage) |
Tries to insert a pathway in the database, checks for validity before insertion If a pathway with the same ID is already inserted, then overwrites the existing one with the new pathway given as a parameter More... | |
bool | insertOrUpdateProcess (IProcess process, out string errorMessage) |
Tries to insert a process in the database, checks for validity before insertion If a process with the same ID is already inserted, then overwrites the existing one with the new process given as a parameter More... | |
bool | insertOrUpdateProcessOutput (IProcess process, IIO output, out string errorMessage) |
bool | insertOrUpdateResource (IResource resource) |
Inserts a new resource in the database or replace the one with the same ID if it already exists More... | |
bool | insertProcessInput (IProcess process, IInput input, bool toGroup, out string errorMessage) |
Inserts an input to a StationaryProcess only if the Input is either and InputWithShare or if the input is an Input More... | |
List< IDependentItem > | mixDependentItems (IDependentItem idi) |
List of all data that is dependent on the inputted object. More... | |
List< IDependentItem > | PathwayDependentItems (IDependentItem pathway, Guid output=new Guid()) |
List all instances that are dependent of the Pathway passed as a argument More... | |
int | PathwayMainOutputResouce (int pathwayId) |
Returns the resource ID of the main output for a given pathway More... | |
List< IDependentItem > | ProcessDependentItems (IDependentItem idi, Guid io=new Guid()) |
Checks if a process is used in pathways, if the io Guid is provided we'll only check for the specified io otherwise we'll check for any of the input or outputs. More... | |
List< IInputResourceReference > | ProduceResource (int resourceId) |
This is a list of all mixes and pathways that output a given resource. More... | |
void | removeInputToBiogenicCarbonMatrix (Dictionary< Guid, Dictionary< Guid, double >> CarbonTransferts, Guid guid) |
Removes the carbon transfer ratio associated with an input Guid More... | |
List< IDependentItem > | resourceDependentItems (IDependentItem r) |
List of all data that is dependent on the inputted object. More... | |
List< IDependentItem > | TechnologyDependentItems (IDependentItem idi) |
List< int > | unUsed () |
List< int > | unUsedMixes () |
This method returns a list of mixes that are un-used by other parts of the sofware. In other words there is no other entitiy in Greet that is dependent on these mixes. More... | |
List< int > | unUsedPathways () |
This method returns a list of pathways that are un-used by other parts of the sofware. In other words there is no other entitiy in Greet that is dependent on these pathways. More... | |
List< int > | unUsedResources () |
This method returns a list of resources that are un-used by other parts of the sofware. In other words there is no other entitiy in Greet that is dependent on these resources. More... | |
List< int > | unUsedTechnologies () |
List< int > | unUsedVehicles () |
This method returns a list of vehicles that are un-used by other parts of the sofware. In other words there is no other entitiy in Greet that is dependent on these vehicles. More... | |
List< int > | usedMixes () |
This method returns a list of mixes that are used by other parts of the software. In other words there are entities in Greet dependent on the exisitence of these mixes. More... | |
List< int > | usedPathways () |
This method returns a list of pathways that are used by other parts of the software. In other words there are entities in Greet dependent on the exisitence of these pathways. More... | |
List< int > | usedProcesses () |
List< int > | usedResources () |
This method returns a list of resources that are used by other parts of the software. In other words there are entities in Greet dependent on the exisitence of these resources. More... | |
List< int > | usedTechnologies () |
List< int > | usedVehicles () |
This method returns a list of vehicles that are used by other parts of the software. In other words there are entities in Greet dependent on the exisitence of these vehicles. More... | |
List< IDependentItem > | VehicleDependentItems (IDependentItem idi) |
List of all data that is dependent on the inputted object. More... | |
A wrapper class for the data class. Simplify the usage of the data class by providing easier entry point to manage data.
The main idea is that by using this wrapper class, the data will be managed and in a consitance state at any time.
It is recomended to use the wrapper class for any operations that are done from External libraries such as Model or Gui. If functionalities are missing, send a request or inplement a new method here and respect the naming convention and conventional interfaces
Greet.DataStructureV3.DataHelper.DataHelper | ( | GData | data | ) |
Default construsctor, needs a reference to an instance of a GData object
data |
void Greet.DataStructureV3.DataHelper.addInputToBiogenicCarbonMatrix | ( | Dictionary< Guid, Dictionary< Guid, double >> | CarbonTransferts, |
IInput | input | ||
) |
Tests if a transfer value can be added for that new input (i.e. if we already have some outputs defined) Otherwise do not change anything to the transfert matrix
CarbonTransferts | Reference to an instance of a CarbonTransferMatrix |
input | Input beeing added |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
void Greet.DataStructureV3.DataHelper.addInputToBiogenicCarbonMatrix | ( | IProcess | process, |
IIO | output | ||
) |
Adds an output ratio to the carbon transfer ratio matrix.
Also adds all inputs that may be added if necessary
process | process for which we want to add an output |
output | the output beeing added to the process |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
IIO Greet.DataStructureV3.DataHelper.createNewCoProduct | ( | int | resourceId, |
double | amount = 0 , |
||
string | quantity = "joules" |
||
) |
Creates a new output if the resource ID exists in the database, returns null otherwise
resourceId | ID of an existing resource |
amount | Design amount for the output |
quantity | Quantity for the design amount |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
IInput Greet.DataStructureV3.DataHelper.createNewInput | ( | int | resourceId, |
double | amount = 0 , |
||
string | quantity = "joules" , |
||
int | source = 0 |
||
) |
Creates a new input if resource ID exists in the database, returns null otherwise
resourceId | ID of an existing resource |
amount | Design amount for the input |
quantity | Quantity for the design amount |
source | Source of the input, 0=Well, 1=Previous, 2=Pathway, 3=Mix |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
IIO Greet.DataStructureV3.DataHelper.createNewMainOutput | ( | int | resourceId, |
double | amount = 0 , |
||
string | quantity = "joules" |
||
) |
Creates a new output if the resource ID exists in the database, returns null otherwise
resourceId | ID of an existing resource |
amount | Design amount for the output |
quantity | Quantity for the design amount |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
IPathway Greet.DataStructureV3.DataHelper.createNewPathway | ( | string | name = "" | ) |
Creates a new instance of a Pathway WITHOUT adding it to the dataset
name | Optional name for the created pathway |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
IProcess Greet.DataStructureV3.DataHelper.createNewProcess | ( | int | type, |
string | name = "" |
||
) |
Creates a new instance of a process either stationary or transportation
type | 0 for stationary, 1 for transportation |
name | Optional name for the newly created process |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
IResource Greet.DataStructureV3.DataHelper.createNewResource | ( | string | name = "" | ) |
Creates a new instance of a resource given a name for that resource
name | Optional name for the resource |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
Creates a new instance of a mix with a new ID and new output ID Takes care of registering all parameters and assiging new IDs
mix | The mix to be duplicated |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
Creates a copy of a pathway with an identical structure but a whole new set of IDs
o |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
IStationaryProcess Greet.DataStructureV3.DataHelper.DuplicateStationaryProcess | ( | IStationaryProcess | stationaryProcess | ) |
Creates a copy of a stationary process with an identical structure but new IDs and parameters
stationaryProcess | The process to be duplicated |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
ITransportationProcess Greet.DataStructureV3.DataHelper.DuplicateTransportationProcess | ( | ITransportationProcess | transportationProcess | ) |
Creates a copy of a transportation process with an identical structure but new IDs and parameters
transportationProcess | The process to be duplicated |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
bool Greet.DataStructureV3.DataHelper.insertOrUpdatePathway | ( | IPathway | pathway, |
out string | errorMessage | ||
) |
Tries to insert a pathway in the database, checks for validity before insertion If a pathway with the same ID is already inserted, then overwrites the existing one with the new pathway given as a parameter
pathway | Pathway to be inserted |
errorMessage | Error messages if any when checking the integrity of that pathway |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
bool Greet.DataStructureV3.DataHelper.insertOrUpdateProcess | ( | IProcess | process, |
out string | errorMessage | ||
) |
Tries to insert a process in the database, checks for validity before insertion If a process with the same ID is already inserted, then overwrites the existing one with the new process given as a parameter
process | Process to be inserted |
errorMessage | Error messages if any when checking the integrity of that process |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
bool Greet.DataStructureV3.DataHelper.insertOrUpdateProcessOutput | ( | IProcess | process, |
IIO | output, | ||
out string | errorMessage | ||
) |
If the output is a MainOutput, sets or update the existing main output of the process
If the output is a CoProduct, adds or update an existing co-product that outputs the same resource ID
process | Process to which we want to add an output(Main output or co-product) |
output | Output to be added to the process |
errorMessage | Error messages if any errors |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
bool Greet.DataStructureV3.DataHelper.insertOrUpdateResource | ( | IResource | resource | ) |
Inserts a new resource in the database or replace the one with the same ID if it already exists
resource | The new resource to be added or used as an update |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
bool Greet.DataStructureV3.DataHelper.insertProcessInput | ( | IProcess | process, |
IInput | input, | ||
bool | toGroup, | ||
out string | errorMessage | ||
) |
Inserts an input to a StationaryProcess only if the Input is either and InputWithShare or if the input is an Input
process | Stationary process to which the input is going to be added |
input | The instance of an input to add to the process |
toGroup | If input is an instance on Input, setting to true will add in process Group, ignored otherwise |
errorMessage | Error message for insertion or errors detected in the process integrity after insertion |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<IDependentItem> Greet.DataStructureV3.DataHelper.mixDependentItems | ( | IDependentItem | idi | ) |
List of all data that is dependent on the inputted object.
pw |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<IDependentItem> Greet.DataStructureV3.DataHelper.PathwayDependentItems | ( | IDependentItem | pathway, |
Guid | output = new Guid() |
||
) |
List all instances that are dependent of the Pathway passed as a argument
pathway | The pathway for which we want to know all the dependencies |
output | Optional GUID for the output that we want to test. If empty all outputs are considered |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
int Greet.DataStructureV3.DataHelper.PathwayMainOutputResouce | ( | int | pathwayId | ) |
Returns the resource ID of the main output for a given pathway
pathwayId |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<IDependentItem> Greet.DataStructureV3.DataHelper.ProcessDependentItems | ( | IDependentItem | idi, |
Guid | io = new Guid() |
||
) |
Checks if a process is used in pathways, if the io Guid is provided we'll only check for the specified io otherwise we'll check for any of the input or outputs.
idi | Process IDependentItem |
io | Specific IO GUID if necessary |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<IInputResourceReference> Greet.DataStructureV3.DataHelper.ProduceResource | ( | int | resourceId | ) |
This is a list of all mixes and pathways that output a given resource.
resourceId | The resource id whose list of possible ways is needed |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
void Greet.DataStructureV3.DataHelper.removeInputToBiogenicCarbonMatrix | ( | Dictionary< Guid, Dictionary< Guid, double >> | CarbonTransferts, |
Guid | guid | ||
) |
Removes the carbon transfer ratio associated with an input Guid
dictionary | Reference to an instance of a CarbonTransferMatrix |
input | ID of Input beeing removed |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<IDependentItem> Greet.DataStructureV3.DataHelper.resourceDependentItems | ( | IDependentItem | r | ) |
List of all data that is dependent on the inputted object.
pw |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<IDependentItem> Greet.DataStructureV3.DataHelper.TechnologyDependentItems | ( | IDependentItem | idi | ) |
List<int> Greet.DataStructureV3.DataHelper.unUsed | ( | ) |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.unUsedMixes | ( | ) |
This method returns a list of mixes that are un-used by other parts of the sofware. In other words there is no other entitiy in Greet that is dependent on these mixes.
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.unUsedPathways | ( | ) |
This method returns a list of pathways that are un-used by other parts of the sofware. In other words there is no other entitiy in Greet that is dependent on these pathways.
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.unUsedResources | ( | ) |
This method returns a list of resources that are un-used by other parts of the sofware. In other words there is no other entitiy in Greet that is dependent on these resources.
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.unUsedTechnologies | ( | ) |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.unUsedVehicles | ( | ) |
This method returns a list of vehicles that are un-used by other parts of the sofware. In other words there is no other entitiy in Greet that is dependent on these vehicles.
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.usedMixes | ( | ) |
This method returns a list of mixes that are used by other parts of the software. In other words there are entities in Greet dependent on the exisitence of these mixes.
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.usedPathways | ( | ) |
This method returns a list of pathways that are used by other parts of the software. In other words there are entities in Greet dependent on the exisitence of these pathways.
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.usedProcesses | ( | ) |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.usedResources | ( | ) |
This method returns a list of resources that are used by other parts of the software. In other words there are entities in Greet dependent on the exisitence of these resources.
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.usedTechnologies | ( | ) |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<int> Greet.DataStructureV3.DataHelper.usedVehicles | ( | ) |
This method returns a list of vehicles that are used by other parts of the software. In other words there are entities in Greet dependent on the exisitence of these vehicles.
Implements Greet.DataStructureV3.Interfaces.IDataHelper.
List<IDependentItem> Greet.DataStructureV3.DataHelper.VehicleDependentItems | ( | IDependentItem | idi | ) |
List of all data that is dependent on the inputted object.
veh |
Implements Greet.DataStructureV3.Interfaces.IDataHelper.