operators module¶
- class operators.AddAnchor(proba: float, **kwargs)[source]¶
Bases:
Operator
Anchor operator: changes the anchors of the schedule.
proba: probability of the operator
- class operators.Assign(proba, list_act: Optional[List] = None, p_act: Optional[List] = None, **kwargs)[source]¶
Bases:
Operator
Assign operator: adds an activity in the schedule
proba: probability of the operator list_act: list of activities to choose from p_act: choice probabilities for the activities chosen_act_proba: probability of the chosen activity
- class operators.Block(proba: float, **kwargs)[source]¶
Bases:
Operator
Block operator: changes the discretization of the schedule.
proba: probability of the operator discret_list: list of possible discretizations in hours
- class operators.InflateDeflate(proba, **kwargs)[source]¶
Bases:
Operator
Inflate/deflate operator: increases or decreases duration of an activity
proba: probability of the operator
- class operators.Location(proba, list_loc=None, p_loc=None, **kwargs)[source]¶
Bases:
Operator
Location operator: changes location associated with activity
proba: probability of the operator list_loc: list of possible locations to choose from p_loc: associated probabilities
- class operators.MetaOperator(proba: float, n_op: int, proba_operators: float, operators: Optional[List] = None, **kwargs)[source]¶
Bases:
Operator
Meta operator: implements a combination of operators
proba: probability of the operator n_op: number of operators to combine proba_operators: probabilities of each operato operators: list of possible operators
- compute_change_proba(prev_schedule: Schedule, new_schedule: Schedule, time: int = 24, n_activities: int = 8, n_discret: int = 4, **kwargs) float [source]¶
Computes forward probability of change.
- property meta_type¶
- class operators.Mode(proba, list_modes=None, p_modes=None, **kwargs)[source]¶
Bases:
Operator
Mode operator: changes mode of transportation associated with activity
proba: probability of the operator list_modes: list of possible modes to choose from p_modes: associated probabilities
- class operators.Operator(optype: str, proba: float, **kwargs)[source]¶
Bases:
object
This class creates an “operator” unit to be used in the estimation process. Operators can easily be created with the OperatorFactory class.
optype: label of the operator
proba: probability associated with the operator
list_operators: the list of currently available operators.
describe: prints information on the operator
apply_change: applies a change to the given schedule.
compute_change_proba: computes probability of change
- property list_operators¶
- property optype¶
- property proba¶
- class operators.OperatorFactory[source]¶
Bases:
object
This class creates an object from the Operator class.
- create(optype: str, **kwargs) Operator [source]¶
Creates an object from the Operator class
- Parameters:
-optype (label of operator) –
-kwargs (other keyword arguments that will be passed to the constructor of the Operator class.) –
- Return type:
- draw(list_operators: List, p_operators: Optional[List] = None, **kwargs) Operator [source]¶
Randomly creates an object from the Operator class, given a list of possible operators and probabilities.
- Parameters:
-list_operators (list of possible operators to choose from) –
-p_operators (list of operator probabilities (must be the same length as list_operators and sum up to 1)) –
-kwargs (other keyword arguments that will be passed to the constructor of the Operator class.) –
- Return type: