sampo.scheduler.utils.obstruction#
Overview#
Tests the probability and, if it’s true, apply the obstruction. |
|
Applying seeks the random part of given WorkGraph and inserts it into that point. |
Classes#
- class sampo.scheduler.utils.obstruction.Obstruction(probability: float, rand: random.Random)#
Bases:
abc.ABCTests the probability and, if it’s true, apply the obstruction.
- generate(wg: sampo.schemas.graph.WorkGraph)#
Tests the probability and, if it’s true, apply the obstruction.
- Parameters:
wg – given WorkGraph
- abstract apply(wg: sampo.schemas.graph.WorkGraph)#
The main method of the obstruction.
Should apply provided obstruction to the given WorkGraph in-place.
- Parameters:
wg – given WorkGraph
- class sampo.scheduler.utils.obstruction.OneInsertObstruction(probability: float, rand: random.Random, insert_wg_getter: Callable[[random.Random], sampo.schemas.graph.WorkGraph])#
Bases:
ObstructionApplying seeks the random part of given WorkGraph and inserts it into that point.
- static from_static_graph(probability: float, rand: random.Random, insert_wg: sampo.schemas.graph.WorkGraph) OneInsertObstruction#
- apply(wg: sampo.schemas.graph.WorkGraph)#
The main method of the obstruction.
Should apply provided obstruction to the given WorkGraph in-place.
- Parameters:
wg – given WorkGraph