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_property

A 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_term

deleter

get_func_return

ensures that the function has a return annotation, and that return annotation is in valid sort types

get_num_items

applies the num_items override or the costmodel default if not set

getter

setter

Attributes

cost_categories

desc

label

must_return

num_items

return_type

stochastic

term_mode

valid_types

valild_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

get_func_return(func)[source]

ensures that the function has a return annotation, and that return annotation is in valid sort types

get_num_items(obj)[source]

applies the num_items override or the costmodel default if not set