internal override AllocatedCase ProcessNewCase(AppealCase appealCase, Hour currentHour) { AllocatedCase allocatedCase = _allocateCase(appealCase, currentHour); _registrar.ProcessIncomingCase(currentHour, allocatedCase); return(allocatedCase); }
internal void ProcessFinishedWork(Hour currentHour, AllocatedCase allocatedCase, Member member) { _circulation.Enqueue(currentHour, allocatedCase); _boardQueue.Dequeue(member); if (allocatedCase.IsFinished) { _finished.Add(allocatedCase); } }
internal WorkReport Work(Hour currentHour, AllocatedCase currentCase) { if (currentCase == null) { return(WorkReport.MakeNullReport()); } return(currentCase.DoWorkAndMakeReport(this, currentHour)); }
internal AllocatedCase Dequeue() { if (Count == 0) { return(default(AllocatedCase)); } AllocatedCase ac = _queue.Dequeue(); _timeOfEnqueuing.Remove(ac); return(ac); }
//working private WorkReport _memberWork(Hour currentHour, AllocatedCase currentCase, Member member) { WorkReport report; report = member.Work(currentHour, currentCase); if (report.State == WorkState.Finished) { _registrar.ProcessFinishedWork(currentHour, currentCase, member); } return(report); }
internal override BoardReport DoWork(Hour currentHour) { BoardReport boardReport = new BoardReport(_members); _registrar.DoWork(currentHour); foreach (Member member in _members) { //working AllocatedCase currentCase = _registrar.GetCurrentCase(currentHour, member); WorkReport report = _memberWork(currentHour, currentCase, member); boardReport.Add(member, report); //boardReport.Add(member, _memberWork(currentHour, member)); } return(boardReport); }
internal void Enqueue(Hour currentHour, AllocatedCase ac) { switch (ac.Stage) { case CaseStage.Summons: _summonsQueue.Enqueue(currentHour, ac); break; case CaseStage.Decision: _decisionQueue.Enqueue(currentHour, ac); break; case CaseStage.OP: case CaseStage.Finished: case CaseStage.Undefined: throw new InvalidOperationException("Appeal is not in Summons or Decision stage."); } }
internal CompletedCaseReport(AllocatedCase allocatedCase) { CaseID = allocatedCase.Case.ID; HourOfCreation = allocatedCase.Case.CreationHour.Value; HourOfAlloction = allocatedCase.Record.Allocation.Value; ChairID = allocatedCase.Board.Chair.ID; RapporteurID = allocatedCase.Board.Rapporteur.ID; OtherMemberID = allocatedCase.Board.OtherMember.ID; _memberIDs[WorkerRole.Chair] = allocatedCase.Board.Chair.ID; _memberIDs[WorkerRole.Rapporteur] = allocatedCase.Board.Chair.ID; _memberIDs[WorkerRole.OtherMember] = allocatedCase.Board.OtherMember.ID; _hourEnqueuedForSummons[WorkerRole.Chair] = allocatedCase.Record.ChairSummons.Enqueue.Value; _hourEnqueuedForSummons[WorkerRole.Rapporteur] = allocatedCase.Record.RapporteurSummons.Enqueue.Value; _hourEnqueuedForSummons[WorkerRole.OtherMember] = allocatedCase.Record.OtherMemberSummons.Enqueue.Value; _hourSummonsWorkStarted[WorkerRole.Chair] = allocatedCase.Record.ChairSummons.Start.Value; _hourSummonsWorkStarted[WorkerRole.Rapporteur] = allocatedCase.Record.RapporteurSummons.Start.Value; _hourSummonsWorkStarted[WorkerRole.OtherMember] = allocatedCase.Record.OtherMemberSummons.Start.Value; _hourSummonsWorkFinished[WorkerRole.Chair] = allocatedCase.Record.ChairSummons.Finish.Value; _hourSummonsWorkFinished[WorkerRole.Rapporteur] = allocatedCase.Record.RapporteurSummons.Finish.Value; _hourSummonsWorkFinished[WorkerRole.OtherMember] = allocatedCase.Record.OtherMemberSummons.Finish.Value; HourOPScheduled = allocatedCase.Record.OP.Enqueue.Value; HourOPStarted = allocatedCase.Record.OP.Start.Value; HourOPFinished = allocatedCase.Record.OP.Finish.Value; _hourEnqueuedForDecision[WorkerRole.Chair] = allocatedCase.Record.ChairDecision.Enqueue.Value; _hourEnqueuedForDecision[WorkerRole.Rapporteur] = allocatedCase.Record.RapporteurDecision.Enqueue.Value; _hourEnqueuedForDecision[WorkerRole.OtherMember] = allocatedCase.Record.OtherMemberDecision.Enqueue.Value; _hourDecsionWorkStarted[WorkerRole.Chair] = allocatedCase.Record.ChairDecision.Start.Value; _hourDecsionWorkStarted[WorkerRole.Rapporteur] = allocatedCase.Record.RapporteurDecision.Start.Value; _hourDecsionWorkStarted[WorkerRole.OtherMember] = allocatedCase.Record.OtherMemberDecision.Start.Value; _hourDecisionWorkFinished[WorkerRole.Chair] = allocatedCase.Record.ChairDecision.Finish.Value; _hourDecisionWorkFinished[WorkerRole.Rapporteur] = allocatedCase.Record.RapporteurDecision.Finish.Value; _hourDecisionWorkFinished[WorkerRole.OtherMember] = allocatedCase.Record.OtherMemberDecision.Finish.Value; }
internal WorkerRole EnqueueForNextWorker(Hour currentHour, AllocatedCase allocatedCase) { CaseWorker nextWorker = null; if (_workerQueues[CaseStage.Summons].Count > 0) { nextWorker = _workerQueues[CaseStage.Summons].Dequeue(); } else if (_workerQueues[CaseStage.Decision].Count > 0) { nextWorker = _workerQueues[CaseStage.Decision].Dequeue(); } if (nextWorker == null) { return(WorkerRole.None); } _registrar.EnqueueForWorker(currentHour, nextWorker, allocatedCase); return(nextWorker.Role); }
internal void Enqueue(Hour currentHour, AllocatedCase allocatedCase) { _queue.Enqueue(currentHour, allocatedCase); }
internal abstract void AddToCirculationQueue(AllocatedCase allocatedCase, Hour currentHour);
internal void Add(AllocatedCase ac) { _list.Add(ac); }
internal override void AddToCirculationQueue(AllocatedCase allocatedCase, Hour currentHour) { _registrar.AddToCirculation(currentHour, allocatedCase); }
internal void ProcessIncomingCase(Hour currentHour, AllocatedCase allocatedCase) { _incoming.Enqueue(currentHour, allocatedCase); }
internal void EnqueueForWorker(Hour currentHour, CaseWorker nextWorker, AllocatedCase allocatedCase) { _boardQueue.EnqueueForMember(currentHour, nextWorker, allocatedCase); }
internal abstract void Schedule(Hour currentHour, AllocatedCase allocatedCase);
internal void EnqueueForMember(Hour currentHour, CaseWorker worker, AllocatedCase allocatedCase) { _checkMemberIsRegistered(worker.Member); _memberQueues[worker.Member].Enqueue(currentHour, allocatedCase, worker.Role); }
internal void ScheduleOP(Hour currentHour, AllocatedCase allocatedCase) { _opSchedule.Schedule(currentHour, allocatedCase); }
internal void Enqueue(Hour hour, AllocatedCase t) { _queue.Enqueue(t); _timeOfEnqueuing[t] = hour; }
internal void Enqueue(Hour currentHour, AllocatedCase ac, WorkerRole role) { _queues[role].Enqueue(currentHour, ac); }
internal void ScheduleOP(Hour currentHour, AllocatedCase allocatedCase) { _registrar.ScheduleOP(currentHour, allocatedCase); }
internal abstract void Add(Hour hour, AllocatedCase allocatedCase);
internal void AddToCirculation(Hour currentHour, AllocatedCase allocatedCase) { _circulation.Enqueue(currentHour, allocatedCase); }