diff --git a/diploma_thesis/environment/machine.py b/diploma_thesis/environment/machine.py index 339b405..12d3348 100644 --- a/diploma_thesis/environment/machine.py +++ b/diploma_thesis/environment/machine.py @@ -326,9 +326,6 @@ def __select_job__(self): if self.state.is_empty: return None - if len(self.state.queue) == 1: - return self.state.queue[0] - job = self.shop_floor.schedule(self) return job diff --git a/diploma_thesis/environment/work_center.py b/diploma_thesis/environment/work_center.py index 606ef2c..e63bebd 100644 --- a/diploma_thesis/environment/work_center.py +++ b/diploma_thesis/environment/work_center.py @@ -128,11 +128,6 @@ def __dispatch__(self): self.history.with_decision_time(self.environment.now) for job in self.state.queue: - if len(self.machines) == 1: - machine = self.machines[0] - machine.receive(job) - continue - self.shop_floor.will_dispatch(job, self) machine = self.shop_floor.route(work_center=self, job=job) diff --git a/diploma_thesis/tape/queue/machine_queue.py b/diploma_thesis/tape/queue/machine_queue.py index 183068b..084755e 100644 --- a/diploma_thesis/tape/queue/machine_queue.py +++ b/diploma_thesis/tape/queue/machine_queue.py @@ -36,18 +36,19 @@ def clear_all(self): @filter(lambda self, context, *args, **kwargs: context.shop_floor.id in self.queue) @filter(lambda self, _, __, record: isinstance(record.result, Job)) def register(self, context: Context, machine: Machine, record: MachineModel.Record): - self.queue[context.shop_floor.id][machine.key][record.result.id] = TapeRecord( - record=Record( - state=record.state, - action=record.action, - next_state=None, - reward=None, - done=False, - batch_size=[] - ), - context=self.reward.record_job_action(record.result, machine, context.moment), - moment=context.moment - ) + if record.result: + self.queue[context.shop_floor.id][machine.key][record.result.id] = TapeRecord( + record=Record( + state=record.state, + action=record.action, + next_state=None, + reward=None, + done=False, + batch_size=[] + ), + context=self.reward.record_job_action(record.result, machine, context.moment), + moment=context.moment + ) @filter(lambda self, context, machine, job: job.id in self.queue[context.shop_floor.id][machine.key]) def record_next_state(self, context: Context, machine: Machine, job: Job):