Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Zero edge lag if finish node is service unit #43

Merged
merged 2 commits into from
Aug 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions sampo/native/python_deserializer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,6 @@ namespace PythonDeserializer {
return EdgeType::FinishFinish;
} else if (value == "FS") {
return EdgeType::FinishStart;
} else if (value == "SF") {
return EdgeType::StartFinish;
} else {
throw logic_error("Illegal EdgeType: " + value);
}
Expand Down
1 change: 0 additions & 1 deletion sampo/native/workgraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ enum EdgeType {
StartStart,
FinishFinish,
FinishStart,
StartFinish,
None
};

Expand Down
1 change: 0 additions & 1 deletion sampo/scheduler/timeline/just_in_time_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,6 @@ def find_min_start_time_with_additional(self, node: GraphNode,
needed_count -= offer_count
ind -= 1

# c_st = max(max_agent_time, max_parent_time, max_neighbor_time)
c_st = max(max_agent_time, max_parent_time)

max_material_time = self._material_timeline.find_min_material_time(node.id, c_st,
Expand Down
6 changes: 3 additions & 3 deletions sampo/scheduler/timeline/momentum_timeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,9 @@ def find_min_start_time_with_additional(self,
:return: start time, end time, time of execution
"""
inseparable_chain = node.get_inseparable_chain_with_self()

contractor_id = worker_team[0].contractor_id if worker_team else ''

# 1. identify earliest possible start time by max parent's end time

def apply_time_spec(time: Time):
Expand Down Expand Up @@ -241,7 +242,7 @@ def _find_earliest_time_slot(state: SortedList[ScheduleEvent],
current_start_idx = state.bisect_right(current_start_time) - 1

# the condition means we have reached the end of schedule for this contractor subject to specialization (wreq)
# as long as we assured that this contractor has enough capacity at all to handle the the task
# as long as we assured that this contractor has enough capacity at all to handle the task
# we can stop and put the task at the very end
i = 0
while len(state[current_start_idx:]) > 0:
Expand All @@ -257,7 +258,6 @@ def _find_earliest_time_slot(state: SortedList[ScheduleEvent],
# so let's go to the end
return state[len(state) - 1].time + 1


# checking from the end of execution interval, i.e., end_idx - 1
# up to (including) the event right prepending the start
# of the execution interval, i.e., current_start_idx - 1
Expand Down
1 change: 0 additions & 1 deletion sampo/schemas/graph.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,6 @@ class EdgeType(Enum):
StartStart = 'SS'
FinishFinish = 'FF'
FinishStart = 'FS'
StartFinish = 'SF'

@staticmethod
def is_dependency(edge) -> bool:
Expand Down
2 changes: 1 addition & 1 deletion sampo/structurator/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ def fill_parents_to_new_nodes(origin_node: GraphNode, id2new_nodes: GraphNodeDic
parents_zero_stage: list[tuple[GraphNode, float, EdgeType]] = []
parents_last_stage: list[tuple[GraphNode, float, EdgeType]] = []
for edge in origin_node.edges_to:
indent = 1 if not edge.start.work_unit.is_service_unit else 0
indent = 1 if not edge.start.work_unit.is_service_unit and not edge.finish.work_unit.is_service_unit else 0
if edge.type in [EdgeType.FinishStart, EdgeType.InseparableFinishStart]:
lag = edge.lag if not edge.lag % 1 else ceil(edge.lag)
lag = lag if lag > 0 else indent
Expand Down