engforge.eng.costs.cost_property
- class cost_property(fget=None, fset=None, fdel=None, doc=None, desc=None, label=None, stochastic=False, mode='initial', category=None, num_items=None)[source]
Bases:
system_propertyA thin wrapper over system_property that will be accounted by Economics Components and apply term & categorization
cost_property should return a float/int always and will raise an error if the return annotation is different, although annotations are not required and will default to float.
#Terms: Terms start counting at 0 and can be evald by the Economic.term_length cost_properties will return their value as system_properties do without regard for the term state, however a CostModel’s costs at a term can be retrived by costs_at_term. The default mode is for initial cost
#Categories: Categories are a way to report cost categories and multiple can be applied to a cost. Categories are grouped by the Economics system at reported in bulk by term and over the term_length
extends system_property interface with mode & category keywords :type mode:
str:param mode: can be one of initial,`maintenance`,`always` or a function with signature f(inst,term,econ) as an integer and returning a boolean True if it is to be applied durring that term.Methods
apply_at_termdeleterensures that the function has a return annotation, and that return annotation is in valid sort types
applies the num_items override or the costmodel default if not set
gettersetterAttributes
cost_categoriesdesclabelmust_returnnum_itemsreturn_typestochasticterm_modevalid_typesvalild_types- Parameters:
mode (str)
category (str | list)
num_items (int)
- __call__(fget=None, fset=None, fdel=None, doc=None)
this will be called when input is provided before property is set