sampo.scheduler.multi_agency.block_generator#

Overview#

Classes#

SyntheticBlockGraphType

Describe types of synthetic block graph:

Function#

generate_empty_graph()

-

generate_blocks(graph_type, n_blocks, type_prop, count_supplier, edge_prob, rand, obstruction_getter, logger)

Generate synthetic block graph according to given parameters.

generate_block_graph(graph_type, n_blocks, type_prop, count_supplier, edge_prob, rand, obstruction_getter, queues_num, queues_blocks, queues_edges, logger)

Generate synthetic block graph of the received type.

generate_queues(type_prop, count_supplier, rand, obstruction_getter, queues_num, queues_blocks, queues_edges, logger)

Generate synthetic block queues graph according to given parameters.

Classes#

class sampo.scheduler.multi_agency.block_generator.SyntheticBlockGraphType#

Bases: enum.Enum

Describe types of synthetic block graph: - Parallel - works can be performed mostly in parallel, - Sequential - works can be performed mostly in sequential, - Random - random structure of block graph, - Queue - queue structure typical of real processes capital construction.

SEQUENTIAL = 0#
PARALLEL = 1#
RANDOM = 2#
QUEUES = 3#

Functions#

sampo.scheduler.multi_agency.block_generator.generate_empty_graph() sampo.schemas.graph.WorkGraph#
sampo.scheduler.multi_agency.block_generator.generate_blocks(graph_type: SyntheticBlockGraphType, n_blocks: int, type_prop: list[int], count_supplier: Callable[[int], tuple[int, int]], edge_prob: float, rand: random.Random | None = Random(), obstruction_getter: Callable[[int], sampo.scheduler.utils.obstruction.Obstruction | None] = lambda _: ..., logger: Callable[[str], None] = print) sampo.scheduler.multi_agency.block_graph.BlockGraph#

Generate synthetic block graph according to given parameters.

Parameters:
  • graph_type – type of BlockGraph

  • n_blocks – the count of blocks

  • type_prop – proportions of the WorkGraph types: General, Parallel, Sequential

  • count_supplier – function that computes the borders of block size from it’s index

  • edge_prob – edge existence probability

  • rand – a random reference

  • obstruction_getter – obstruction, that can be inserted in BlockGraph

Returns:

generated block graph

sampo.scheduler.multi_agency.block_generator.generate_block_graph(graph_type: SyntheticBlockGraphType, n_blocks: int, type_prop: list[int], count_supplier: Callable[[int], tuple[int | None, int | None]], edge_prob: float, rand: random.Random | None = Random(), obstruction_getter: Callable[[int], sampo.scheduler.utils.obstruction.Obstruction | None] = lambda _: ..., queues_num: int | None = None, queues_blocks: list[int] | None = None, queues_edges: list[int] | None = None, logger: Callable[[str], None] = print) sampo.scheduler.multi_agency.block_graph.BlockGraph#

Generate synthetic block graph of the received type.

Parameters:
  • graph_type – type of Block Graph

  • n_blocks – number of blocks

  • type_prop – proportions of the WorkGraph types: General, Parallel, Sequential, Queues

  • count_supplier – function that computes the borders of block size from it’s index

  • edge_prob – edge existence probability

  • rand – a random reference

  • obstruction_getter

  • queues_num – number of queues in a block graph

  • queues_blocks – list of queues. It contains the number of blocks in each queue

  • queues_edges

  • logger – for logging

Returns:

generated block graph

sampo.scheduler.multi_agency.block_generator.generate_queues(type_prop: list[int], count_supplier: Callable[[int], tuple[int, int]], rand: random.Random | None = Random(), obstruction_getter: Callable[[int], sampo.scheduler.utils.obstruction.Obstruction | None] = lambda _: ..., queues_num: int | None = None, queues_blocks: list[int] | None = None, queues_edges: list[int] | None = None, logger: Callable[[str], None] = print) sampo.scheduler.multi_agency.block_graph.BlockGraph#

Generate synthetic block queues graph according to given parameters.

Parameters:
  • type_prop – proportions of the WorkGraph types: General, Parallel, Sequential

  • count_supplier – function that computes the borders of block size from it’s index

  • rand – a random reference

  • obstruction_getter

  • queues_num – number of queues in a block graph

  • queues_blocks – list of queues. It contains the number of blocks in each queue

  • queues_edges

Returns:

generated block graph

Attributes#

sampo.scheduler.multi_agency.block_generator.EMPTY_GRAPH_VERTEX_COUNT = 2#