pam.optimise.random
Stopper(horizon=5, sensitivity=0.01)
#
Early stopping mechanism. Maintains last n scores, where n is equal to "horizon". Triggers an early stop if change across horizon is less than given sensitivity.
PARAMETER | DESCRIPTION |
---|---|
horizon |
length of stored history. Defaults to 5.
TYPE:
|
sensitivity |
stopping tolerance. Defaults to 0.01.
TYPE:
|
Source code in src/pam/optimise/random.py
print_report(initial_score, best_score, n)
#
random_mutate_activity_durations(plan, copy=True)
#
Rearrange input plan into random new plan, maintaining activity sequence and trip durations.
Source code in src/pam/optimise/random.py
reschedule(plan, plans_scorer, config={}, horizon=5, sensitivity=0.01, patience=1000)
#
Randomly search for an improved plan sequence based on given plans_scorer.
This is not seriously suggested as a sensible approach, it is supplied for example only.
PARAMETER | DESCRIPTION |
---|---|
plan |
Input plan.
TYPE:
|
plans_scorer |
Plans scorer.
TYPE:
|
config |
plans_scorer configuration. Defaults to {}.
TYPE:
|
horizon |
Early stopper horizon. Defaults to 5.
TYPE:
|
sensitivity |
Early stopper sensitivity. Defaults to 0.01.
TYPE:
|
patience |
Defaults to 1000.
TYPE:
|
RETURNS | DESCRIPTION |
---|---|
(Plan, float)
|
best plan found and best score. |