Recipe Cookbook#
cookbook contains Recipes to build Aspects.
from energia import Model, Process
Accessing Recipes#
One Recipe for a particular aspect is only called once, when the Aspect is called for the first time.
m = Model()
m.cookbook
{'capacity': capacity,
'setup': setup,
'dismantle': dismantle,
'operate': operate,
'rampup': rampup,
'rampdown': rampdown,
'produce': produce,
'expend': expend,
'ship_in': ship_in,
'ship_out': ship_out,
'invcapacity': invcapacity,
'invdismantle': invdismantle,
'invsetup': invsetup,
'inventory': inventory,
'consume': consume,
'release': release,
'buy': buy,
'sell': sell,
'earn': earn,
'spend': spend,
'emit': emit,
'abate': abate,
'benefit': benefit,
'detriment': detriment,
'dispose': dispose,
'use': use}
Recipe Information#
Recipes contain information regarding the primary component type.
add and sub are control Aspects, if the Aspect is a State
bound is an Aspect that provides a (scaled) bound
m.cookbook['operate'].__dict__
{'name': 'operate',
'kind': energia.modeling.variables.states.SetPoint,
'primary_type': (energia.components.operations.process.Process,
energia.components.operations.transport.Transport),
'label': 'Capacity Utilization',
'add': 'rampup',
'sub': 'rampdown',
'bound': 'capacity',
'ctrl': '',
'ispos': True,
'nn': True,
'use_multiplier': False,
'latex': '{opr}',
'args': {'primary_type': (energia.components.operations.process.Process,
energia.components.operations.transport.Transport),
'label': 'Capacity Utilization',
'add': 'rampup',
'sub': 'rampdown',
'bound': 'capacity',
'ispos': True,
'nn': True,
'use_multiplier': False,
'latex': '{opr}'}}
Creating Your Own Recipe#
Your own Recipes can be added as shown:
from energia.modeling.variables.states import State
m.Recipe('feel', kind=State, primary_type=Process, ispos=False)