sampo.generator.pipeline.extension#

Overview#

Function#

_extend_str_fields(new_uniq_count, wg, rand, uniq_finder_str, update_node)

-

_get_uniq_resource_kinds(wg)

-

_update_resource_names(node, name_to_suffixes, rand)

-

_get_uniq_work_names(wg)

-

_update_work_name(node, name_to_suffixes, rand)

-

extend_resources(uniq_resources, wg, rand)

Increases the number of unique resources in WorkGraph

extend_names(uniq_activities, wg, rand)

Increases the number of unique work names in WorkGraph

Functions#

sampo.generator.pipeline.extension._extend_str_fields(new_uniq_count: int, wg: sampo.schemas.graph.WorkGraph, rand: random.Random, uniq_finder_str: Callable[[sampo.schemas.graph.WorkGraph], list[str]], update_node: Callable[[sampo.schemas.graph.GraphNode, dict[str, list[str]], random.Random], None]) sampo.schemas.graph.WorkGraph#
sampo.generator.pipeline.extension._get_uniq_resource_kinds(wg: sampo.schemas.graph.WorkGraph) list[str]#
sampo.generator.pipeline.extension._update_resource_names(node: sampo.schemas.graph.GraphNode, name_to_suffixes: dict[str, list[str]], rand: random.Random)#
sampo.generator.pipeline.extension._get_uniq_work_names(wg: sampo.schemas.graph.WorkGraph) list[str]#
sampo.generator.pipeline.extension._update_work_name(node: sampo.schemas.graph.GraphNode, name_to_suffixes: dict[str, list[str]], rand: random.Random) None#
sampo.generator.pipeline.extension.extend_resources(uniq_resources: int, wg: sampo.schemas.graph.WorkGraph, rand: random.Random) sampo.schemas.graph.WorkGraph#

Increases the number of unique resources in WorkGraph

Parameters:
  • uniq_resources – the amount to which you need to increase

  • wg – original WorkGraph

  • rand – Number generator with a fixed seed, or None for no fixed seed

Returns:

modified WorkGraph

sampo.generator.pipeline.extension.extend_names(uniq_activities: int, wg: sampo.schemas.graph.WorkGraph, rand: random.Random) sampo.schemas.graph.WorkGraph#

Increases the number of unique work names in WorkGraph

Parameters:
  • uniq_activities – the amount to which you need to increase

  • wg – original WorkGraph

  • rand – Number generator with a fixed seed, or None for no fixed seed

Returns:

modified WorkGraph