Skip to content

Commit

Permalink
Fixed problems with lag counting (#85)
Browse files Browse the repository at this point in the history
  • Loading branch information
StannisMod authored Oct 2, 2024
1 parent e98bd23 commit 11e2c4a
Show file tree
Hide file tree
Showing 7 changed files with 5,028 additions and 1,359 deletions.
12 changes: 9 additions & 3 deletions examples/SAMPO_scheduling_tutorial.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,9 @@
}
},
"cell_type": "code",
"source": "from field_dev_resources_time_estimator import FieldDevWorkEstimator",
"source": [
"from field_dev_resources_time_estimator import FieldDevWorkEstimator"
],
"outputs": [],
"execution_count": 2
},
Expand Down Expand Up @@ -148,7 +150,9 @@
{
"metadata": {},
"cell_type": "markdown",
"source": "## ДЛЯ ИНТЕГРАЦИИ В STAIRS"
"source": [
"## ДЛЯ ИНТЕГРАЦИИ В STAIRS"
]
},
{
"cell_type": "code",
Expand Down Expand Up @@ -4042,7 +4046,9 @@
}
},
"cell_type": "code",
"source": "scheduling_project.schedule.pure_schedule_df",
"source": [
"scheduling_project.schedule.pure_schedule_df"
],
"outputs": [
{
"data": {
Expand Down
6,351 changes: 5,005 additions & 1,346 deletions examples/visualization.ipynb

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "sampo"
version = "0.1.1.342"
version = "0.1.1.348"
description = "Open-source framework for adaptive manufacturing processes scheduling"
authors = ["iAirLab <iairlab@yandex.ru>"]
license = "BSD-3-Clause"
Expand Down
6 changes: 3 additions & 3 deletions sampo/pipeline/default.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,13 +70,13 @@ def __init__(self):
self._all_connections: bool = False
self._change_connections_info: bool = False
self._name_mapper: NameMapper | None = None
self.sep_wg = ';'
self.sep_history = ';'
self.sep_wg = ','
self.sep_history = ','

def wg(self,
wg: WorkGraph | pd.DataFrame | str,
change_base_on_history: bool = False,
sep: str = ';',
sep: str = ',',
all_connections: bool = False,
change_connections_info: bool = False) -> 'InputPipeline':
"""
Expand Down
2 changes: 1 addition & 1 deletion sampo/scheduler/timeline/just_in_time_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ def _schedule_with_inseparables(self,
if dep_node in exec_times:
lag, working_time = exec_times[dep_node]
else:
lag, working_time = 0, work_estimator.estimate_time(node.work_unit, workers)
lag, working_time = 0, work_estimator.estimate_time(dep_node.work_unit, workers)
c_st = max(c_ft + lag, max_parent_time)

deliveries, mat_del_time = self._material_timeline.deliver_resources(dep_node,
Expand Down
10 changes: 7 additions & 3 deletions sampo/scheduler/timeline/momentum_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -418,13 +418,17 @@ def _schedule_with_inseparables(self,
worker_team: list[Worker],
contractor: Contractor,
start_time: Time,
exec_times: dict[GraphNode, tuple[Time, Time]]):
exec_times: dict[GraphNode, tuple[Time, Time]],
work_estimator: WorkTimeEstimator = DefaultWorkEstimator()):
# 6. create a schedule entry for the task
# nodes_start_times = {ins_node: ins_node.min_start_time(node2swork) for ins_node in inseparable_chain}

curr_time = start_time
for i, chain_node in enumerate(inseparable_chain):
node_lag, node_time = exec_times[chain_node]
if chain_node in exec_times:
node_lag, node_time = exec_times[chain_node]
else:
node_lag, node_time = 0, work_estimator.estimate_time(chain_node.work_unit, worker_team)

# lag_req = nodes_start_times[chain_node] - curr_time
# node_lag = lag_req if lag_req > 0 else 0
Expand All @@ -434,7 +438,7 @@ def _schedule_with_inseparables(self,
start_work,
chain_node.work_unit.need_materials())
start_work = max(start_work, mat_del_time)
self._validate(start_work + node_time, node_time, worker_team)
# self._validate(start_work + node_time, node_time, worker_team)
swork = ScheduledWork(
work_unit=chain_node.work_unit,
start_end_time=(start_work, start_work + node_time),
Expand Down
4 changes: 2 additions & 2 deletions sampo/userinput/parser/history.py
Original file line number Diff line number Diff line change
Expand Up @@ -204,9 +204,9 @@ def get_all_seq_statistic(history_data: pd.DataFrame,
count])
else:
if order_con == 1:
predecessors_info_dict[w2_id].append([w1_id, 'FS', 1.0, count])
predecessors_info_dict[w2_id].append([w1_id, 'FS', 0.0, count])
else:
predecessors_info_dict[w1_id].append([w2_id, 'FS', 1.0, count])
predecessors_info_dict[w1_id].append([w2_id, 'FS', 0.0, count])
elif ss > ffs:
if order_con == 1:
predecessors_info_dict[w2_id].append([w1_id, 'SS',
Expand Down

0 comments on commit 11e2c4a

Please sign in to comment.