sampo.scheduler.multi_agency.block_graph#

Overview#

Classes#

BlockNode

BlockNode represents the node of BlockGraph and contains corresponding

BlockGraph

Represents the block graph, where blocks are instances of WorkGraph and

Classes#

class sampo.scheduler.multi_agency.block_graph.BlockNode(wg: sampo.schemas.graph.WorkGraph, obstruction: sampo.scheduler.utils.obstruction.Obstruction | None = None)#

BlockNode represents the node of BlockGraph and contains corresponding WorkGraph and related dependencies between blocks in BlockGraph.

property id#
is_service()#
__hash__()#

Return hash(self).

class sampo.scheduler.multi_agency.block_graph.BlockGraph(nodes: list[BlockNode])#

Represents the block graph, where blocks are instances of WorkGraph and edges are simple FS dependencies.

static pure(nodes: list[sampo.schemas.graph.WorkGraph], obstruction_getter: Callable[[int], sampo.scheduler.utils.obstruction.Obstruction | None] = lambda _: ...)#

Build BlockGraph from the received list of WorkGraphs without edges

Parameters:
  • nodes – list of WorkGraphs without edges - blocks of BlockGraphs

  • obstruction_getter

Returns:

BlockGraph without edges

__getitem__(item) BlockNode#
__len__()#
__copy__()#
to_work_graph() sampo.schemas.graph.WorkGraph#

Construct ‘WorkGraph’ that is equal to the BlockGraph.

toposort() list[BlockNode]#

Sort current ‘BlockGraph’ in topologic order

Returns:

ordered list of BlockNode

static add_edge(start: BlockNode, end: BlockNode)#