Documentation ¶
Index ¶
- Constants
- Variables
- func GetEmissionFactor(emissions []*Emission, i int, fuel *Resource, db *DB) *unit.Unit
- type BasicParameters
- type Compatibility
- type Coproduct
- func (cp *Coproduct) CalcAllocationAmount(outputUnits unit.Dimensions, AllocationMethod string, db *DB) *unit.Unit
- func (cp *Coproduct) GetAmount(db *DB) *unit.Unit
- func (cp *Coproduct) GetAmountBeforeLoss(db *DB) *unit.Unit
- func (cp *Coproduct) GetID() slca.OutputID
- func (cp *Coproduct) GetLossEmissions(_ *DB) ([]*Gas, []*unit.Unit)
- func (cp *Coproduct) GetName(db *DB) string
- func (cp *Coproduct) GetProcess(path *Pathway, db *DB) slca.Process
- func (cp *Coproduct) GetResource(db slca.LCADB) slca.Resource
- func (cp *Coproduct) IsCoproduct() bool
- type Coproducts
- type DB
- func (db *DB) AddSCCs(stationaryProcessFile, vehicleFile, technologyFile io.Reader) error
- func (db *DB) EditByID(changes *DB)
- func (db *DB) EditExpressionByID(ID string, newValue float64) error
- func (db *DB) EndUseFromID(ID string) (slca.Pathway, error)
- func (db *DB) EndUses() ([]slca.Pathway, []string)
- func (db *DB) GetGas(name string) (*Gas, error)
- func (db *DB) GetMix(ID ModelID) *Mix
- func (db *DB) GetPathway(ID ModelID) *Pathway
- func (db *DB) GetPathwayMixOrVehicleFromName(name string) (slca.Pathway, error)
- func (db *DB) GetResource(id ResourceID, requester interface{}) *Resource
- func (db *DB) GetResourceFromName(name string) *Resource
- func (db *DB) GetResultVars() (ids, names []string)
- func (db *DB) GetVariableValue(varName string) *unit.Unit
- func (db *DB) GetVehicleFromID(ID ModelID) *Vehicle
- func (db *DB) GetVehicleFromName(name string) *Vehicle
- func (db *DB) GetYear() float64
- func (db *DB) InterpolateValue(y []*ValueYear) *unit.Unit
- func (db *DB) InterpolateValueWithLag(y []*ValueYear, lag float64) *unit.Unit
- func (db *DB) SpatialSCCs() []slca.SCC
- func (db *DB) Write(w io.Writer) (int, error)
- type Data
- type Edge
- type Emission
- type EmissionRatio
- type EmissionYear
- type EnergyIntensity
- type EvaporationShare
- type Expression
- type Fuel
- type FuelShare
- type FuelShareID
- type Gas
- type GasGroup
- type GasID
- type Guid
- type IOCarbonInput
- type IOCarbonMap
- type IOCarbonOutput
- type Input
- func (in *Input) EmissionsAndResourceUse(r *slca.OnsiteResults, proc slca.Process, path *Pathway, ...)
- func (in *Input) GetAmount(db *DB) *unit.Unit
- func (in *Input) GetAmountDefaultUnits(db *DB) *unit.Unit
- func (in *Input) GetEmissionRatios(db *DB) ([]*Gas, []*unit.Unit)
- func (in *Input) GetResource(db *DB) *Resource
- func (in *Input) GetShare(db *DB) *unit.Unit
- func (in *Input) GetSource(path *Pathway, db *DB) (slca.Process, *Pathway)
- type InputColumn
- type InputGroup
- type InputID
- type InputTable
- type Location
- type LocationGroup
- type LocationGroupID
- type LocationID
- type LocationMembership
- type Locations
- type Membership
- type Mix
- func (m *Mix) GetID() ModelID
- func (m *Mix) GetIDStr() string
- func (m *Mix) GetMainOutput(db slca.LCADB) slca.Output
- func (m *Mix) GetName() string
- func (m *Mix) GetOutput(r slca.Resource, db slca.LCADB) slca.Output
- func (m *Mix) GetOutputProcess(_ *Resource, _ slca.LCADB) slca.Process
- func (m *Mix) MainProcessAndOutput(db slca.LCADB) (slca.Process, slca.Output)
- func (m *Mix) OnsiteResults(_ slca.Pathway, o slca.Output, lcadb slca.LCADB) *slca.OnsiteResults
- func (m *Mix) SpatialRef(aqm string) *slca.SpatialRef
- func (m *Mix) Type() slca.ProcessType
- type MixPathway
- type MixResource
- type Mode
- func (m *Mode) CalculateEnergyIntensity(materialTransported *Resource, fuel *Fuel, db *DB) (from, to *unit.Unit)
- func (m *Mode) GetAverageSpeed(db *DB) *unit.Unit
- func (m *Mode) GetBSFCAdjustment(db *DB) *unit.Unit
- func (m *Mode) GetFuelEconomyFrom(db *DB) *unit.Unit
- func (m *Mode) GetFuelEconomyTo(db *DB) *unit.Unit
- func (m *Mode) GetHPFactor(db *DB) *unit.Unit
- func (m *Mode) GetLoadFactorFrom(db *DB) *unit.Unit
- func (m *Mode) GetLoadFactorTo(db *DB) *unit.Unit
- func (m *Mode) GetPayload(r *Resource, db *DB) *unit.Unit
- func (m *Mode) GetPipelineEnergyIntensity(r *Resource, db *DB) *unit.Unit
- func (m *Mode) GetRailEnergyIntensity(db *DB) *unit.Unit
- func (m *Mode) GetTypicalFC(db *DB) *unit.Unit
- func (m *Mode) GetTypicalHP(db *DB) *unit.Unit
- type ModeID
- type ModelID
- type NLoss
- type OtherEmission
- type Output
- func (o *Output) CalcAllocationAmount(outputUnit unit.Dimensions, AllocationMethod string, db *DB) *unit.Unit
- func (o *Output) GetAmount(db *DB) *unit.Unit
- func (o *Output) GetAmountBeforeLoss(db *DB) *unit.Unit
- func (o *Output) GetID() slca.OutputID
- func (o *Output) GetLossEmissions(db *DB) ([]*Gas, []*unit.Unit)
- func (o *Output) GetNLoss(db *DB) *unit.Unit
- func (o *Output) GetName(db *DB) string
- func (o *Output) GetProcess(path *Pathway, db *DB) slca.Process
- func (o *Output) GetResource(db slca.LCADB) slca.Resource
- func (o *Output) IsCoproduct() bool
- type OutputLike
- type Param
- type Parameter
- type Pathway
- func (path *Pathway) GetID() ModelID
- func (path *Pathway) GetIDStr() string
- func (path *Pathway) GetMainOutput(_ slca.LCADB) slca.Output
- func (path *Pathway) GetName() string
- func (path *Pathway) GetOutput(rI slca.Resource, lcadb slca.LCADB) slca.Output
- func (path *Pathway) GetOutputProcess(r *Resource, lcadb slca.LCADB) slca.Process
- func (path *Pathway) MainProcessAndOutput(lcadb slca.LCADB) (slca.Process, slca.Output)
- func (path *Pathway) Type() string
- func (path *Pathway) VertexForMainOutput() *Vertex
- func (path *Pathway) VertexForOutput(o *Output, db *DB) *Vertex
- type PathwayLike
- type Payload
- type Product
- type Resource
- func (r *Resource) ConvertToDefaultUnits(amt *unit.Unit, dbI slca.LCADB) *unit.Unit
- func (r *Resource) ConvertToEnergy(amt *unit.Unit, db *DB) *unit.Unit
- func (r *Resource) ConvertToMarketValue(amt *unit.Unit, db *DB) *unit.Unit
- func (r *Resource) ConvertToMass(amt *unit.Unit, db *DB) *unit.Unit
- func (r *Resource) ConvertToVolume(amt *unit.Unit, db *DB) *unit.Unit
- func (r *Resource) GetCRatio(db *DB) *unit.Unit
- func (r *Resource) GetDensity(db *DB) *unit.Unit
- func (r *Resource) GetEvaporationShares(db *DB) ([]*Gas, []*unit.Unit)
- func (r *Resource) GetHeatingValueMass(db *DB) *unit.Unit
- func (r *Resource) GetHeatingValueVolume(db *DB) *unit.Unit
- func (r *Resource) GetID() string
- func (r *Resource) GetMarketValue(db *DB) *unit.Unit
- func (r *Resource) GetName() string
- func (r *Resource) GetSRatio(db *DB) *unit.Unit
- func (r *Resource) IsCompatible(other *Resource) bool
- type ResourceGroup
- type ResourceID
- type StationaryProcess
- func (p *StationaryProcess) GetID() ModelID
- func (p *StationaryProcess) GetIDStr() string
- func (p *StationaryProcess) GetMainOutput(db slca.LCADB) slca.Output
- func (p *StationaryProcess) GetName() string
- func (p *StationaryProcess) GetOutput(rI slca.Resource, db slca.LCADB) slca.Output
- func (p *StationaryProcess) OnsiteResults(pathI slca.Pathway, outputI slca.Output, lcadb slca.LCADB) *slca.OnsiteResults
- func (p *StationaryProcess) SpatialRef(aqm string) *slca.SpatialRef
- func (p *StationaryProcess) Type() slca.ProcessType
- type Step
- func (s *Step) GetDistance(db *DB) *unit.Unit
- func (s *Step) GetLossAmount(res *Resource, amountTransported *unit.Unit, db *DB) *unit.Unit
- func (s *Step) GetLossEmissions(res *Resource, amountTransported *unit.Unit, db *DB) ([]*Gas, []*unit.Unit)
- func (s *Step) GetModeAndFuelShare(db *DB) (*Mode, *FuelShare)
- func (s *Step) GetNLoss(db *DB) *unit.Unit
- func (s *Step) GetShare(db *DB) *unit.Unit
- type Technology
- type TechnologyID
- type TechnologyShare
- type TransportationProcess
- func (p *TransportationProcess) GetID() ModelID
- func (p *TransportationProcess) GetIDStr() string
- func (p *TransportationProcess) GetInput() *Input
- func (p *TransportationProcess) GetMainOutput(db slca.LCADB) slca.Output
- func (p *TransportationProcess) GetName() string
- func (p *TransportationProcess) GetOutput(res slca.Resource, db slca.LCADB) slca.Output
- func (p *TransportationProcess) OnsiteResults(pathI slca.Pathway, outputI slca.Output, lcadb slca.LCADB) *slca.OnsiteResults
- func (p *TransportationProcess) SpatialRef(aqm string) *slca.SpatialRef
- func (p *TransportationProcess) Type() slca.ProcessType
- type Unit
- type ValueYear
- type Vehicle
- func (v *Vehicle) GetID() ModelID
- func (v *Vehicle) GetIDStr() string
- func (v *Vehicle) GetMainOutput(_ slca.LCADB) slca.Output
- func (v *Vehicle) GetName() string
- func (v *Vehicle) GetOutput(_ slca.Resource, _ slca.LCADB) slca.Output
- func (v *Vehicle) MainProcessAndOutput(db slca.LCADB) (slca.Process, slca.Output)
- func (v *Vehicle) OnsiteResults(_ slca.Pathway, _ slca.Output, lcadb slca.LCADB) *slca.OnsiteResults
- func (v *Vehicle) SpatialRef(aqm string) *slca.SpatialRef
- func (v *Vehicle) Type() slca.ProcessType
- type Vertex
- type VertexID
Constants ¶
const DefaultNonCombustionSCC slca.SCC = "0028888801" // TODO: Perhaps figure out a way to do better.
DefaultNonCombustionSCC is used for everything we don't have an SCC for.
Variables ¶
var DebugLevel = 0
DebugLevel sets the amount of debugging output that is written to the console. Higher numbers lead to more output.
Functions ¶
func GetEmissionFactor ¶
GetEmissionFactor returns the emissions factor for emission corresponding to index i in emissions. fuel is used to calculate some emissions factors based on fuel properties. It should be safe to pass a nil value for fuel for non-combustion emissions.
Types ¶
type BasicParameters ¶
type BasicParameters struct { YearSelected Expression `xml:"year_selected,attr"` LHV bool `xml:"lhv,attr"` }
BasicParameters holds the GREET database basic parameters.
type Compatibility ¶
type Compatibility struct {
MatID ResourceID `xml:"mat_id,attr"`
}
Compatibility gives another resource this resource is compatible with.
type Coproduct ¶
type Coproduct struct { ID slca.OutputID `xml:"id,attr"` Ref ResourceID `xml:"ref,attr"` AmountYears []*ValueYear `xml:"amount>year"` Method string `xml:"method,attr"` // either "allocation" or "displacement" ConventionalProducts []*Product `xml:"conventional_products>product"` }
Coproduct is a holder for information about a single coproduct.
func (*Coproduct) CalcAllocationAmount ¶
func (cp *Coproduct) CalcAllocationAmount(outputUnits unit.Dimensions, AllocationMethod string, db *DB) *unit.Unit
CalcAllocationAmount calculates the amount of this coproduct to be used when allocating resource use and emissions. If AllocationMethod is "", it allocates all emissions to the main output and none to the coproducts.
func (*Coproduct) GetAmountBeforeLoss ¶
GetAmountBeforeLoss calculates the amount of this coproduct is produced. Because coproducts do not have losses, it gives the same result as GetAmount().
func (*Coproduct) GetLossEmissions ¶
GetLossEmissions is required to fulfill the OutputLike interface, but coproducts don't have any loss emissions.
func (*Coproduct) GetName ¶
GetName gets the name associated with the resource produced by this coproduct.
func (*Coproduct) GetProcess ¶
GetProcess returns the process associated with this Coproduct.
func (*Coproduct) GetResource ¶
GetResource returns the resource associated with this coproduct.
func (*Coproduct) IsCoproduct ¶
IsCoproduct is for implementing the OutputLike interface and is always true.
type Coproducts ¶
type Coproducts struct { // Either "Mass", "Energy", "Market", "Volume" or "" AllocationMethod string `xml:"allocation_method,attr"` Coprods []*Coproduct `xml:"coproduct"` }
Coproducts is a holder for data about the coproducts of a process and how to deal with them.
func (*Coproducts) Displacement ¶
func (cps *Coproducts) Displacement(r *slca.OnsiteResults, db *DB)
Displacement calculates the amounts of different processes that are displaced by this process. The results are returned as negative numbers.
type DB ¶
type DB struct { Version string `xml:"version,attr"` BasicParameters *BasicParameters `xml:"basic_parameters"` Data *Data `xml:"data"` // SpatialSCCs are all the SCC codes used by this database // for spatialization. SCC codes that are not // used for spatialization are not included here. SpatialSCC []slca.SCC // contains filtered or unexported fields }
DB is a holder for the GREET database.
func (*DB) AddSCCs ¶
AddSCCs adds SCC codes to the greet database by matching information in sscFile.
func (*DB) EditByID ¶
EditByID makes changes to db as specified by "changes". Edits are made by matching ID numbers in db and changes. Only existing objects can be edited. This function has not been exhaustively tested, so use at your own risk.
func (*DB) EditExpressionByID ¶
EditExpressionByID finds the expression with an ID matching "ID" and sets the value to newValue. It returns an error if "ID" is not found or if there is more than one expression matching "ID" in the database.
func (*DB) EndUseFromID ¶
EndUseFromID returns the pathway mix, or vehicle with the given id.
func (*DB) EndUses ¶
EndUses returns information about the pathways, mixes, and vehicles in this database.
func (*DB) GetGas ¶
GetGas returns the gas in the database with the specified name. It returns an error if there is no match.
func (*DB) GetPathway ¶
GetPathway returns the pathway with the given id.
func (*DB) GetPathwayMixOrVehicleFromName ¶
GetPathwayMixOrVehicleFromName returns the pathway, mix, or vehicle with the given name.
func (*DB) GetResource ¶
func (db *DB) GetResource(id ResourceID, requester interface{}) *Resource
GetResource returns the resource with the specified ID. The requester input is only used for debugging if the resource is not found.
func (*DB) GetResourceFromName ¶
GetResourceFromName returns the resource with the specified name.
func (*DB) GetResultVars ¶
GetResultVars returns the gases and resources that can be considered as model result types.
func (*DB) GetVariableValue ¶
GetVariableValue finds the desired variable in the database, evaluates it, and returns the result.
func (*DB) GetVehicleFromID ¶
GetVehicleFromID finds the vehicle in the database with the matching ID.
func (*DB) GetVehicleFromName ¶
GetVehicleFromName finds the vehicle in the database with the matching ID.
func (*DB) InterpolateValue ¶
InterpolateValue returns the value associated with the year set in the GREET database, interpolating if necessary.
func (*DB) InterpolateValueWithLag ¶
InterpolateValueWithLag returns the value associated with the year set in the GREET database minus the specified lag (in years), interpolating if necessary.
func (*DB) SpatialSCCs ¶
SpatialSCCs returns all of the SCC codes used by this database for spatialization.
type Data ¶
type Data struct { Pathways []*Pathway `xml:"pathways>pathway"` ResourceGroups []*ResourceGroup `xml:"resources>groups>group"` Resources []*Resource `xml:"resources>resources>resource"` TransportationProcesses []*TransportationProcess `xml:"processes>transportation"` StationaryProcesses []*StationaryProcess `xml:"processes>stationary"` Technologies []*Technology `xml:"technologies>technology"` Modes []*Mode `xml:"modes>mode"` Locations Locations `xml:"locations"` GasGroups []*GasGroup `xml:"gases>groups>group"` Gases []*Gas `xml:"gases>gases>gas"` // VehicleTechnologyLag gives the lag in years between the current year // and the vehicle model year. VehicleTechnologyLag struct { Value Expression `xml:"value,attr"` } `xml:"vehicles>vehicle_technology_lag"` Vehicles []*Vehicle `xml:"vehicles>vehicle"` Mixes []*Mix `xml:"mixes>mix"` InputTables []*InputTable `xml:"inputs>input"` }
Data is a holder for the LCA data within the GREET database.
type Edge ¶
type Edge struct { // The OutputVertexID references a vertex in the current Pathway. // It is the upstream vertex. OutputVertexID VertexID `xml:"output-vertex,attr"` // Output ID references an output. The actual location of the output // should be in a process or another pathway. OutputID slca.OutputID `xml:"output-id,attr"` // InputVertexID either references a vertex in the current pathway // (the downstream vertex), or it matches the ID of one of the outputs // from the pathway. If it matches a pathway output, then it means // that this edge is to a pathway output rather than another vertex. InputVertexID VertexID `xml:"input-vertex,attr"` // InputID either matches one of the inputs in the process associated // with InputVertexID, or it matches one of the pathway output IDs. // If it matches a pathway output, then it means // that this edge is to a pathway output rather than another vertex. InputID InputID `xml:"input-id,attr"` }
An Edge connects two vertices in a pathway or one vertex in a pathway to a pathway output.
func (*Edge) GetInputVertex ¶
GetInputVertex gets the input vertex for this edge.
func (*Edge) GetOutputVertex ¶
GetOutputVertex gets the output vertex for this edge.
type Emission ¶
type Emission struct { Ref GasID `xml:"ref,attr"` Factor Expression `xml:"factor,attr"` Amount Expression `xml:"amount,attr"` Calculated bool `xml:"calculated,attr"` }
Emission is a holder for emissions data in the GREET database.
type EmissionRatio ¶
An EmissionRatio specifies the fraction of the total mass of an input that is emitted as a certain gas.
type EmissionYear ¶
EmissionYear is a holder for emissions information for a specific year in the GREET database.
func (*EmissionYear) GetYear ¶
func (e *EmissionYear) GetYear() float64
GetYear converts the year of this emission from string to float format.
type EnergyIntensity ¶
type EnergyIntensity struct { EnergyIntensity Param `xml:"ei"` Ref ResourceID `xml:"ref,attr"` Name string `xml:"name,attr"` }
EnergyIntensity specifies the energy intensity of a Mode. Only used for rail.
type EvaporationShare ¶
type EvaporationShare struct {}
EvaporationShare gives the fraction of a given resource that evaporates as a given gas.
type Fuel ¶
type Fuel struct { FuelRef ResourceID `xml:"fuel_ref,attr"` Pathway ModelID `xml:"pathway,attr"` Mix ModelID `xml:"mix,attr"` TechToID TechnologyID `xml:"tech_to,attr"` TechFromID TechnologyID `xml:"tech_from,attr"` }
Fuel specifies a type of fuel used by a Mode.
func (*Fuel) GetPathway ¶
GetPathway returns the pathway or mix that provides the fuel.
func (*Fuel) GetTechFrom ¶
func (f *Fuel) GetTechFrom(db *DB) *Technology
GetTechFrom returns the technology that is providing inbound transportation
func (*Fuel) GetTechTo ¶
func (f *Fuel) GetTechTo(db *DB) *Technology
GetTechTo returns the technology that is providing outbound transportation
type FuelShare ¶
type FuelShare struct {}
FuelShare gives information on the different fuels used by a Mode.
type Gas ¶
type Gas struct { Ref string `xml:"ref,attr"` Name string `xml:"name,attr"` ID GasID `xml:"id,attr"` CRatio Expression `xml:"c_ratio,attr"` // mass ratio SRatio Expression `xml:"s_ratio,attr"` // mass ratio GlobalWarmingPotential string `xml:"global_warming_potential,attr"` Membership []*Membership `xml:"membership"` }
Gas is a holder for emissions types in the GREET database.
type IOCarbonInput ¶
IOCarbonInput is a holder for the fraction biogenic vs. fossil carbon.
type IOCarbonMap ¶
type IOCarbonMap struct {
Outputs []*IOCarbonOutput `xml:"output"`
}
IOCarbonMap is a holder for information about biogenic and fossil carbon
type IOCarbonOutput ¶
type IOCarbonOutput struct { ID slca.OutputID `xml:"id,attr"` Inputs *IOCarbonInput `xml:"input"` }
IOCarbonOutput is a holder for information about biogenic and fossil carbon
type Input ¶
type Input struct { ID InputID `xml:"id,attr"` // The Source of the input. Should either be Previous, Mix, Well, or Pathway. Source string `xml:"source,attr"` // The mix that is the source of this input if Source = "Mix" Mix ModelID `xml:"mix,attr"` // The pathway that is the source of this input if Source = "Pathway". Pathway ModelID `xml:"pathway,attr"` // Is this considered the main input? ConsideredAsMain bool `xml:"considered_as_main,attr"` // Whether requirements and resource use are counted in this input. If "False", // only count emissions. AccountedInEnergyBalance string `xml:"accounted_in_energy_balance,attr"` // The resource that is input. Ref ResourceID `xml:"ref,attr"` Share Param `xml:"share"` TechnologyShares []*TechnologyShare `xml:"technology"` // The amount of this input. Used in non-grouped inputs. AmountYears []*ValueYear `xml:"amount>year"` // EmissionRatios specify fractions of the total mass of the input that // are emitted as different gases. EmissionRatios []EmissionRatio `xml:"emission_ratio"` }
Input is a holder for the GREET Input data type.
func (*Input) EmissionsAndResourceUse ¶
func (in *Input) EmissionsAndResourceUse(r *slca.OnsiteResults, proc slca.Process, path *Pathway, noncombustion subprocess, db *DB)
EmissionsAndResourceUse calculates emissions caused and resources used by this input.
func (*Input) GetAmountDefaultUnits ¶
GetAmountDefaultUnits gets the amount of this input in the default units for the input resource.
func (*Input) GetEmissionRatios ¶
GetEmissionRatios returns the emission ratios associated with this input.
func (*Input) GetResource ¶
GetResource gets the resource associated with this input.
type InputColumn ¶
type InputColumn struct { Name string `xml:"name,attr"` ID string `xml:"id,attr"` Parameters []Parameter `xml:"param"` }
InputColumn is a holder for a GREET input data table column.
type InputGroup ¶
type InputGroup struct { Type string `xml:"type,attr"` // This should be "efficiency" or "amount" Efficiency []*ValueYear `xml:"efficiency>year"` Amount []*ValueYear `xml:"amount>year"` Inputs []*Input `xml:"input"` }
InputGroup is a holder for a group of inputs sharing a common efficiency or adding up to a single amount.
func (*InputGroup) EmissionsAndResourceUse ¶
func (ig *InputGroup) EmissionsAndResourceUse(r *slca.OnsiteResults, proc slca.Process, path *Pathway, output OutputLike, noncombustion subprocess, db *DB)
EmissionsAndResourceUse calculates emissions caused and resources used by this input group. The returned value is a pointer and is cached for future use, so be sure to clone the result before modifying it.
type InputTable ¶
type InputTable struct { ID string `xml:"id,attr"` TabID string `xml:"tabid,attr"` Notes string `xml:"notes,attr"` ModifiedOn string `xml:"modified_on,attr"` ModifiedBy string `xml:"modified_by,attr"` Columns []InputColumn `xml:"column"` }
InputTable is a holder for a GREET input data table.
type Location ¶
type Location struct { Name string `xml:"name,attr"` Picture string `xml:"picture,attr"` ID LocationID `xml:"id,attr"` Notes string `xml:"notes,attr"` Membership []*LocationMembership `xml:"membership"` }
Location holds information about a transportation source or destination location.
type LocationGroup ¶
type LocationGroup struct { Name string `xml:"name,attr"` ID LocationGroupID `xml:"id,attr"` Notes string `xml:"notes,attr"` }
LocationGroup holds information about how different locations can be combined into groups.
type LocationGroupID ¶
type LocationGroupID string
LocationGroupID holds the ID code for a location group
type LocationMembership ¶
type LocationMembership struct {
GroupID LocationGroupID `xml:"group_id,attr"`
}
LocationMembership gives information about which group a location belongs to.
type Locations ¶
type Locations struct { LocationGroups []LocationGroup `xml:"groups>group"` Locations []*Location `xml:"location"` }
Locations is a holder for transportation source and destination locations.
type Membership ¶
type Membership struct {
GroupID string `xml:"group_id"`
}
Membership gives a group that a resource is a member of.
type Mix ¶
type Mix struct { sync.RWMutex ID ModelID `xml:"id,attr"` Name string `xml:"name,attr"` UseDefaultValues bool `xml:"use_default_values,attr"` CreatedResource ResourceID `xml:"created_resource,attr"` PathwayRefs []*MixPathway `xml:"pathway"` MixRefs []*MixResource `xml:"resource"` PreferredFunctionalUnit *Unit `xml:"prefered_functional_unit"` Outputs []*Output `xml:"output"` // contains filtered or unexported fields }
Mix is a holder for GREET data about pathway mixes.
func (*Mix) GetMainOutput ¶
GetMainOutput returns the main output from this mix.
func (*Mix) GetOutput ¶
GetOutput returns the output of this mix that outputs the requested resource.
func (*Mix) GetOutputProcess ¶
GetOutputProcess returns the receiver.
func (*Mix) MainProcessAndOutput ¶
MainProcessAndOutput returns the process that outputs the main output of the receiver, and also returns that output.
func (*Mix) OnsiteResults ¶
OnsiteResults is required for a mix to fulfill the slca.Process interface, but pathways don't directly create any emissions. The returned value is a pointer and is cached for future use, so be sure to clone the result before modifying it.
func (*Mix) SpatialRef ¶
func (m *Mix) SpatialRef(aqm string) *slca.SpatialRef
SpatialRef returns this spatial reference for this mix (which is NoSpatial).
type MixPathway ¶
type MixPathway struct { Ref string `xml:"ref,attr"` OutputID slca.OutputID `xml:"output,attr"` Notes string `xml:"notes,attr"` }
MixPathway is a holder for the corresponding GREET datatype. It defines the pathways that are upstream of the current mix.
type MixResource ¶
MixResource is a holder for the corresponding GREET datatype. It defines the mixes that are upstream of the current mix.
type Mode ¶
type Mode struct { Name string `xml:"name,attr"` Type string `xml:"type,attr"` ID ModeID `xml:"id,attr"` AverageSpeed Param `xml:"average_speed"` // [length/time] // Load factor is the percentage of installed power that is used for the trip LoadFactorFrom Param `xml:"load_factor_from"` // [Dimless] LoadFactorTo Param `xml:"load_factor_to"` // [Dimless] FuelEconomyFrom Param `xml:"fuel_economy_from"` FuelEconomyTo Param `xml:"fuel_economy_to"` // TypicalFC is the mass of fuel consumption per unit of output work // (Brake specific fuel consumption (BSFC)). TypicalFC Param `xml:"typical_fc"` // [mass/energy] // TypicalHP is the amount of power required when the vehicle is unloaded. TypicalHP Param `xml:"typical_hp"` // [power] // HPFactor is the amount of additional power required per unit mass of payload. HPFactor Param `xml:"hp_factor"` // [power/mass] // EnergyIntensity is energy used per unit distance per unit payload mass. It is only reported // directly for the rail mode. EnergyIntensity Param `xml:"ei"` // [energy/distance/mass] // BSFCAdjustment defines how (brake-specific) fuel consumption varies with // varying load factor. BSFCAdjustment Param `xml:"bsfc_adjustment"` Payloads []*Payload `xml:"payload>material_transported"` // Energy intensity for pipelines EnergyIntensities []*EnergyIntensity `xml:"energy_intensity>material_transported"` }
Mode is a holder for information about a transportation mode.
func (*Mode) CalculateEnergyIntensity ¶
func (m *Mode) CalculateEnergyIntensity(materialTransported *Resource, fuel *Fuel, db *DB) (from, to *unit.Unit)
CalculateEnergyIntensity returns the energy used per unit distance per unit payload mass for this mode, for both the outbound and inbound legs of the journey.
func (*Mode) GetAverageSpeed ¶
GetAverageSpeed returns the average speed for this mode.
func (*Mode) GetBSFCAdjustment ¶
GetBSFCAdjustment returns the brake-specific fuel consumption adjustment factor.
func (*Mode) GetFuelEconomyFrom ¶
GetFuelEconomyFrom returns the fuel economy in the from or inbound direction.
func (*Mode) GetFuelEconomyTo ¶
GetFuelEconomyTo returns the fuel economy in the to or outbound direction.
func (*Mode) GetHPFactor ¶
GetHPFactor gets the power adjustment factor.
func (*Mode) GetLoadFactorFrom ¶
GetLoadFactorFrom returns the load factor in the from or inbound direction.
func (*Mode) GetLoadFactorTo ¶
GetLoadFactorTo returns the load factor in the to or outbound direction.
func (*Mode) GetPayload ¶
GetPayload returns the payload for this mode carrying the specified resource.
func (*Mode) GetPipelineEnergyIntensity ¶
GetPipelineEnergyIntensity gets the energy intensity for the mode in transporting the given resource. It only works for pipelines.
func (*Mode) GetRailEnergyIntensity ¶
GetRailEnergyIntensity returns the energy intensity for the rail mode.
func (*Mode) GetTypicalFC ¶
GetTypicalFC returns the typical fuel consumption.
type ModelID ¶
type ModelID string
ModelID holds the ID code for a Process model (TransportationProcess or StationaryProcess)
type NLoss ¶
type NLoss struct { Rate Expression `xml:"rate,attr"` Dependency string `xml:"dependency,attr"` }
NLoss is a holder for product loss fraction during a transportation step.
type OtherEmission ¶
type OtherEmission struct { // TODO: What does MostRecent mean? MostRecent string `xml:"mostRecent,attr"` Ref GasID `xml:"ref,attr"` ValueYears []*ValueYear `xml:"year"` Notes string `xml:"notes,attr"` }
OtherEmission is a holder for "other" emissions from StationaryProcesses.
func (*OtherEmission) Amount ¶
func (e *OtherEmission) Amount(db *DB) *unit.Unit
Amount returns the amount of emission.
func (*OtherEmission) Gas ¶
func (e *OtherEmission) Gas(db *DB) *Gas
Gas returns the gas associated with this emission
type Output ¶
type Output struct { ID slca.OutputID `xml:"id,attr"` ResourceID ResourceID `xml:"resource,attr"` Ref ResourceID `xml:"ref,attr"` AmountYears []*ValueYear `xml:"amount>year"` NLoss *NLoss `xml:"nloss"` }
Output is a holder for the type and amount of a resource that is output from a process or pathway.
func (*Output) CalcAllocationAmount ¶
func (o *Output) CalcAllocationAmount(outputUnit unit.Dimensions, AllocationMethod string, db *DB) *unit.Unit
CalcAllocationAmount calculates the amount of this output to be used when allocating resource use and emissions. If AllocationMethod is "", it allocates all emissions to the main output and none to the coproducts.
func (*Output) GetAmount ¶
GetAmount calculates the amount of this output after accounting for losses.
func (*Output) GetAmountBeforeLoss ¶
GetAmountBeforeLoss calculates the amount of this output without accounting for losses.
func (*Output) GetLossEmissions ¶
GetLossEmissions calculates emissions through evaporation of a product (or other losses).
func (*Output) GetProcess ¶
GetProcess returns the process associated with this output.
func (*Output) GetResource ¶
GetResource returns the resource associated with this output.
func (*Output) IsCoproduct ¶
IsCoproduct returns whether this output is a coproduct. It is an output, not a coproduct, the the answer is always false.
type OutputLike ¶
type OutputLike interface { IsCoproduct() bool GetName(*DB) string GetAmount(*DB) *unit.Unit GetAmountBeforeLoss(*DB) *unit.Unit GetResource(slca.LCADB) slca.Resource GetProcess(*Pathway, *DB) slca.Process GetID() slca.OutputID CalcAllocationAmount(outputUnits unit.Dimensions, AllocationMethod string, db *DB) *unit.Unit GetLossEmissions(*DB) ([]*Gas, []*unit.Unit) }
OutputLike is an interface that allows the use of outputs and coproducts together.
type Param ¶
type Param struct { // TODO: What does MostRecent mean? MostRecent string `xml:"mostRecent,attr"` ValueYears []*ValueYear `xml:"year"` }
Param is one type of variable parameter from the GREET database (different from Parameter).
type Parameter ¶
type Parameter struct { Name string `xml:"name,attr"` ID string `xml:"id,attr"` Value Expression `xml:"value,attr"` ValueYears *Param `xml:"values"` }
Parameter is one type of variable parameter from the GREET database (different from Param). It holds the data in a GREET input table cell.
type Pathway ¶
type Pathway struct { sync.RWMutex ID ModelID `xml:"id,attr"` Name string `xml:"name,attr"` Notes string `xml:"notes,attr"` MainOutput slca.OutputID `xml:"main-output,attr"` Vertices []*Vertex `xml:"vertex"` Edges []*Edge `xml:"edge"` Outputs []*Output `xml:"output"` }
Pathway is holder for a pathway in the GREET model. Refer to the GREET documentation for more information.
func (*Pathway) GetMainOutput ¶
GetMainOutput returns the main output from this pathway.
func (*Pathway) GetOutputProcess ¶
GetOutputProcess returns the process that outputs resource r. It assumes only one process outputs resource r from this pathway.
func (*Pathway) MainProcessAndOutput ¶
MainProcessAndOutput returns the process that outputs the main output of the receiver, and also returns that output.
func (*Pathway) VertexForMainOutput ¶
VertexForMainOutput returns the vertex associated with the main output of the pathway.
type PathwayLike ¶
type PathwayLike interface { GetName() string GetID() ModelID GetMainOutput(slca.LCADB) slca.Output GetOutput(slca.Resource, slca.LCADB) slca.Output GetOutputProcess(*Resource, slca.LCADB) slca.Process }
PathwayLike is an interface for things that can be treated like a pathway.
type Payload ¶
type Payload struct { Payload Expression `xml:"payload,attr"` Ref ResourceID `xml:"ref,attr"` }
Payload specifies the amount of a given resource that a Mode can carry.
type Product ¶
type Product struct { Ref ResourceID `xml:"ref,attr"` PathwayID ModelID `xml:"pathway,attr"` MixID ModelID `xml:"mix,attr"` RatioStr Expression `xml:"ratio,attr"` }
Product is a holder for information about the product that is being displaced by a coproduct.
func (*Product) GetProcess ¶
GetProcess returns the process and pathway this coproduct is displacing.
type Resource ¶
type Resource struct { HiddenAsMain bool `xml:"hidden_as_main,attr"` CanBePrimary bool `xml:"can_be_primary,attr"` MarketValue Expression `xml:"market_value,attr"` Density Expression `xml:"density,attr"` HeatingValueHHV Expression `xml:"heating_value_hhv,attr"` HeatingValueLHV Expression `xml:"heating_value_lhv,attr"` Temperature string `xml:"temperature,attr"` Pressure string `xml:"pressure,attr"` ID ResourceID `xml:"id,attr"` Name string `xml:"name,attr"` CRatio Expression `xml:"c_ratio,attr"` SRatioDefault Expression `xml:"s_ratio,attr"` SRatioYear []*ValueYear `xml:"s_ratio>year"` State string `xml:"state,attr"` Family string `xml:"family,attr"` NickName []string `xml:"nick_name"` Membership []*Membership `xml:"membership"` Compatibility []*Compatibility `xml:"compatibility"` Evaporation []*EvaporationShare `xml:"evaporation>gas"` }
Resource is a holder for the GREET model Resource type. Refer to the GREET documentation for more information.
func (*Resource) ConvertToDefaultUnits ¶
ConvertToDefaultUnits converts the amount of the resource to the default units for this resource: energy for resources in in the "energy" state and mass for all other states. If the resource doesn't contain enough information to make the conversion, however, the original value will be returned.
func (*Resource) ConvertToEnergy ¶
ConvertToEnergy converts an amount of this resource to energy units.
func (*Resource) ConvertToMarketValue ¶
ConvertToMarketValue converts an amount of this resource to its market value
func (*Resource) ConvertToMass ¶
ConvertToMass converts an amount of this resource to mass units.
func (*Resource) ConvertToVolume ¶
ConvertToVolume converts an amount of this resource to volume units.
func (*Resource) GetDensity ¶
GetDensity returns the density of this resource.
func (*Resource) GetEvaporationShares ¶
GetEvaporationShares returns the gas that this resource evaporates to, and the fraction that is evaporated.
func (*Resource) GetHeatingValueMass ¶
GetHeatingValueMass returns the mass-specific heating value for this resource.
func (*Resource) GetHeatingValueVolume ¶
GetHeatingValueVolume returns the volume-specific heating value for this resource.
func (*Resource) GetMarketValue ¶
GetMarketValue returns the market value for this resource.
func (*Resource) IsCompatible ¶
IsCompatible returns true if two resources are compatible.
type ResourceGroup ¶
type ResourceGroup struct { ID string `xml:"id,attr"` Name string `xml:"name"` IncludeIn string `xml:"include_in"` }
ResourceGroup is a group of resources.
type StationaryProcess ¶
type StationaryProcess struct { sync.RWMutex `xml:"-"` ID ModelID `xml:"id,attr"` Name string `xml:"name,attr"` IOCarbonMap *IOCarbonMap `xml:"io-carbon-map"` PreferredFunctionalUnit *Unit `xml:"prefered_functional_unit"` Outputs []*Output `xml:"output"` Inputs []*Input `xml:"input"` InputGroups []*InputGroup `xml:"group"` Coproducts *Coproducts `xml:"coproducts"` OtherEmissions []*OtherEmission `xml:"other_emissions>emission"` Notes string `xml:"notes,attr"` // Spatial reference information for this process SpatialReference *slca.SpatialRef // NoncombustionSCC is used for speciating non-combustion emissions. NoncombustionSCC slca.SCC // contains filtered or unexported fields }
StationaryProcess is a holder for stationary process data from the GREET database.
func (*StationaryProcess) GetID ¶
func (p *StationaryProcess) GetID() ModelID
GetID returns the ID of this process.
func (*StationaryProcess) GetIDStr ¶
func (p *StationaryProcess) GetIDStr() string
GetIDStr returns the ID of this process in string format.
func (*StationaryProcess) GetMainOutput ¶
func (p *StationaryProcess) GetMainOutput(db slca.LCADB) slca.Output
GetMainOutput gets the main output of this process. It panics if there is more than one main output.
func (*StationaryProcess) GetName ¶
func (p *StationaryProcess) GetName() string
GetName returns the name of this process.
func (*StationaryProcess) GetOutput ¶
GetOutput gets the output (or coproduct) of this process that outputs the given resource. It assumes that there is only one output or coproduct for each resource. It panics if none of the outputs output the given resource.
func (*StationaryProcess) OnsiteResults ¶
func (p *StationaryProcess) OnsiteResults(pathI slca.Pathway, outputI slca.Output, lcadb slca.LCADB) *slca.OnsiteResults
OnsiteResults calculates the onsite emissions from and resource use of this process per unit output, where "output" is the output that is required from the process, "path" is the pathway the process is a part of.
func (*StationaryProcess) SpatialRef ¶
func (p *StationaryProcess) SpatialRef(aqm string) *slca.SpatialRef
SpatialRef returns the spatial reference for the receiver.
func (*StationaryProcess) Type ¶
func (p *StationaryProcess) Type() slca.ProcessType
Type returns the process type.
type Step ¶
type Step struct { DestRef LocationID `xml:"dest_ref,attr"` OriginRef LocationID `xml:"origin_ref,attr"` Ref ModeID `xml:"ref,attr"` Distance Param `xml:"distance"` BackHaul bool `xml:"back_haul,attr"` // Is an empty backhaul required? ID string `xml:"id,attr"` NLoss *NLoss `xml:"nloss"` }
Step is a holder for a step in a transportation process.
func (*Step) GetDistance ¶
GetDistance returns the distance traveled by this step.
func (*Step) GetLossAmount ¶
GetLossAmount calculates the loss of the transported resource during this step.
func (*Step) GetLossEmissions ¶
func (s *Step) GetLossEmissions(res *Resource, amountTransported *unit.Unit, db *DB) ( []*Gas, []*unit.Unit)
GetLossEmissions calculates emissions through evaporation of a product (or other losses).
func (*Step) GetModeAndFuelShare ¶
GetModeAndFuelShare gets the mode and fuel share associated with this step
type Technology ¶
type Technology struct { ID TechnologyID `xml:"id,attr"` Name string `xml:"name,attr"` InputRef ResourceID `xml:"inputRef,attr"` OutputRef ResourceID `xml:"outputRef,attr"` MassTransfer string `xml:"massTransfer,attr"` BaseTech string `xml:"basetech,attr"` EmissionsYear []*EmissionYear `xml:"year"` SCC slca.SCC }
Technology is a holder for the GREET technology type. Refer to the GREET documentation for more information.
func (*Technology) GetEmissions ¶
func (t *Technology) GetEmissions(db *DB) ([]*Gas, []*unit.Unit)
GetEmissions returns the emissions associated with this technology
func (*Technology) GetID ¶
func (t *Technology) GetID() VertexID
GetID returns the ID of this Technology.
func (*Technology) GetInputResource ¶
func (t *Technology) GetInputResource(db *DB) *Resource
GetInputResource gets the resource used as an input for this technology
func (*Technology) GetName ¶
func (t *Technology) GetName() string
GetName returns the name of this technology.
func (*Technology) GetOutputResource ¶
func (t *Technology) GetOutputResource(db *DB) *Resource
GetOutputResource gets the resource output by this technology
func (*Technology) GetSCC ¶
func (t *Technology) GetSCC() slca.SCC
GetSCC returns the SCC code associated with this technology.
type TechnologyShare ¶
type TechnologyShare struct {}
TechnologyShare holds information about the fraction of work done by a technology.
func (*TechnologyShare) GetShare ¶
func (ts *TechnologyShare) GetShare(db *DB) *unit.Unit
GetShare returns the share associated with this TechnologyShare
func (*TechnologyShare) GetTechnology ¶
func (ts *TechnologyShare) GetTechnology(db *DB) *Technology
GetTechnology returns the Technology associated with this TechnologyShare
type TransportationProcess ¶
type TransportationProcess struct { sync.RWMutex `xml:"-"` ID ModelID `xml:"id,attr"` Name string `xml:"name,attr"` IOCarbonMap *IOCarbonMap `xml:"io-carbon-map"` PreferredFunctionalUnit *Unit `xml:"prefered_functional_unit"` Outputs []*Output `xml:"output"` Inputs []*Input `xml:"input"` MoistureStr Expression `xml:"moisture,attr"` Steps []*Step `xml:"step"` Notes string `xml:"notes,attr"` // contains filtered or unexported fields }
TransportationProcess is a holder for transportation process data from the GREET database.
func (*TransportationProcess) GetID ¶
func (p *TransportationProcess) GetID() ModelID
GetID returns the ID of this process.
func (*TransportationProcess) GetIDStr ¶
func (p *TransportationProcess) GetIDStr() string
GetIDStr returns the ID of this process in string format.
func (*TransportationProcess) GetInput ¶
func (p *TransportationProcess) GetInput() *Input
GetInput gets the single input to this process. It panics if there is more than one input.
func (*TransportationProcess) GetMainOutput ¶
func (p *TransportationProcess) GetMainOutput(db slca.LCADB) slca.Output
GetMainOutput gets the main output of this process. It panics if there is more than one main output.
func (*TransportationProcess) GetName ¶
func (p *TransportationProcess) GetName() string
GetName gets the name of this process.
func (*TransportationProcess) GetOutput ¶
GetOutput gets the output of this process that outputs the given resource. Transportation processes should only have one output, so it panics if there is more or less than one output or if the output does not output the given resource.
func (*TransportationProcess) OnsiteResults ¶
func (p *TransportationProcess) OnsiteResults(pathI slca.Pathway, outputI slca.Output, lcadb slca.LCADB) *slca.OnsiteResults
OnsiteResults calculates the onsite emissions from and resource use of this process per unit output, where "output" is the output that is required from the process, "path" is the pathway the process is a part of. The returned value is a pointer and is cached for future use, so be sure to clone the result before modifying it.
func (*TransportationProcess) SpatialRef ¶
func (p *TransportationProcess) SpatialRef(aqm string) *slca.SpatialRef
SpatialRef returns the spatial reference for the receiver. TODO: Need to implement something for this.
func (*TransportationProcess) Type ¶
func (p *TransportationProcess) Type() slca.ProcessType
Type returns the process type.
type Unit ¶
type Unit struct { Unit string `xml:"unit,attr"` Amount float64 `xml:"amount,attr"` Enabled bool `xml:"enabled,attr"` }
Unit is a holder for a value with units.
type ValueYear ¶
type ValueYear struct { Value Expression `xml:"value,attr"` Year string `xml:"year,attr"` }
ValueYear is a holder for a value that applies to a specific year.
type Vehicle ¶
type Vehicle struct { sync.Mutex ID ModelID `xml:"id,attr"` Name string `xml:"name,attr"` Notes string `xml:"notes,attr"` // Modes gives information on the mode the vehicle is operating in. // Plug-in hybrid vehicles can operate in multiple modes. Modes []struct { Name string `xml:"name,attr"` ID ModelID `xml:"id,attr"` VMTShare []*ValueYear `xml:"vmtShare>year"` // Plant holds information about a vehicle power plant. Plant struct { Name string `xml:"name,attr"` ID Guid `xml:"id,attr"` Notes string `xml:"notes,attr"` Fuel struct { Resource ResourceID `xml:"ref,attr"` Pathway ModelID `xml:"pathway,attr"` Consumption []*ValueYear `xml:"consumption>year"` ChargingEfficiency []*ValueYear `xml:"charging_efficiency>year"` } `xml:"fuel"` Emissions []struct { Gas GasID `xml:"id,attr"` Value []*ValueYear `xml:"value_ts>year"` } `xml:"emission"` } `xml:"plant"` } `xml:"mode"` LifetimeVMT []*ValueYear `xml:"lifetime_vmt>year"` // Manufacturing holds information about // emissions and resource use from the manufacturing // of groups of vehicle components. Manufacturing []struct { Name string `xml:"name,attr"` // Materials holds information on materials // used in vehicle manufacturing. Materials []struct { Resource ResourceID `xml:"resource_id,attr"` Source ModelID `xml:"entity_id,attr"` SourceType string `xml:"source_type,attr"` // Quantity is the amount needed of this // pathway per unit. Quantity []*ValueYear `xml:"quantity>year"` // Replacements is the number of times each // unit will need to be replaced during // the vehicle lifetime. Replacements []*ValueYear `xml:"replacements>year"` // Units is the number of units per vehicle. Units []*ValueYear `xml:"units>year"` } `xml:"material"` } `xml:"manufacturing"` NonCombustionEmissions []struct { Gas GasID `xml:"id,attr"` Values []*ValueYear `xml:"year"` } `xml:"nonCombustionEmission"` // SCC is the SCC code for this vehicle. SCC slca.SCC // contains filtered or unexported fields }
Vehicle is a holder for information about a vehicle in the GREET database.
func (*Vehicle) GetMainOutput ¶
GetMainOutput always returns nil because vehicles have no process outputs.
func (*Vehicle) MainProcessAndOutput ¶
MainProcessAndOutput returns the process that outputs the main output of the receiver, and also returns that output.
func (*Vehicle) OnsiteResults ¶
func (v *Vehicle) OnsiteResults(_ slca.Pathway, _ slca.Output, lcadb slca.LCADB) *slca.OnsiteResults
OnsiteResults calculates the from-vehicle emissions and vehicle resource use per unit output as part of a life cycle calculation, as well as requirements of other pathways. The returned results are emissions and resource use per meter driven by the vehicle.
func (*Vehicle) SpatialRef ¶
func (v *Vehicle) SpatialRef(aqm string) *slca.SpatialRef
SpatialRef returns the spatial reference for the receiver. TODO: Need to implement something for this.
func (*Vehicle) Type ¶
func (v *Vehicle) Type() slca.ProcessType
Type returns the type of this process.
type Vertex ¶
type Vertex struct { ID VertexID `xml:"id,attr"` ModelID ModelID `xml:"model-id,attr"` Type string `xml:"type,attr"` // 0=process; 1=pathway; 2=mix }
Vertex is a holder for the Vertex datatype in the GREET database.
func (*Vertex) GetProcess ¶
func (this *Vertex) GetProcess(requestingPath *Pathway, resource *Resource, db *DB) (slca.Process, *Pathway)
GetProcess finds the corresponding process model for this vertex. It can be a *StationaryProcess, *TransportationProcess, *Pathway, or *Mix. If it is a stationary or transportation process, it is assumed to be part of the requestingPathway.