sampo.scheduler.utils.obstruction#

Overview#

Classes#

Obstruction

Tests the probability and, if it’s true, apply the obstruction.

OneInsertObstruction

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.ABC

Tests 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: Obstruction

Applying 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