raplan.analysis
¶
Tools for maintenance planning and scheduling analysis.
SCHEDULE_FN
module-attribute
¶
SCHEDULE_FN = dict(
SYNC_START_EARLIEST=_sync_start_earliest,
SYNC_START_LATEST=_sync_start_latest,
SYNC_START_MEAN=_sync_start_mean,
SYNC_END_EARLIEST=_sync_end_earliest,
SYNC_END_LATEST=_sync_end_latest,
SYNC_END_MEAN=_sync_end_mean,
)
Maintenance task scheduling functions.
ClassToKind
¶
Class to Kind conversion.
KindToClass
¶
Kind to Class conversion.
get_maintenance_graph
¶
Get a graph of maintenance tasks. Edges are generated with an adjacency value of of the threshold minus the time difference between tasks.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
project
|
Project
|
Scheduling project to generate a graph for. |
required |
threshold
|
int | float
|
Maximum time difference. Tasks that are within this threshold will be assigned an adjacency edge. |
required |
Returns:
| Type | Description |
|---|---|
Graph
|
Graph of maintenance tasks. |
Source code in src/raplan/analysis.py
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 | |
process_clustered_maintenance
¶
process_clustered_maintenance(
graph: Graph,
schedule_fn: Callable[
[list[Node]], list[int | float]
] = SCHEDULE_FN["SYNC_START_EARLIEST"],
)
Check for maintenance nodes with parents and synchronize their times.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
Graph
|
Maintenance graph. |
required |
schedule_fn
|
Callable[[list[Node]], list[int | float]]
|
A method that takes a list of (maintenance) nodes and returns a new list with modified starting times to incorporate. It should not modify the nodes in-place. |
SCHEDULE_FN['SYNC_START_EARLIEST']
|
Source code in src/raplan/analysis.py
project_from_graph
¶
Recreate a Project from a Graph. Utilizes the 'data' annotation to build base objects, and overrides it with data found in the graph constructs.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
graph
|
Graph
|
Graph data. |
required |