示例#1
0
        internal override AllocatedCase ProcessNewCase(AppealCase appealCase, Hour currentHour)
        {
            AllocatedCase allocatedCase = _allocateCase(appealCase, currentHour);

            _registrar.ProcessIncomingCase(currentHour, allocatedCase);
            return(allocatedCase);
        }
示例#2
0
 internal void ProcessFinishedWork(Hour currentHour, AllocatedCase allocatedCase, Member member)
 {
     _circulation.Enqueue(currentHour, allocatedCase);
     _boardQueue.Dequeue(member);
     if (allocatedCase.IsFinished)
     {
         _finished.Add(allocatedCase);
     }
 }
示例#3
0
        internal WorkReport Work(Hour currentHour, AllocatedCase currentCase)
        {
            if (currentCase == null)
            {
                return(WorkReport.MakeNullReport());
            }

            return(currentCase.DoWorkAndMakeReport(this, currentHour));
        }
示例#4
0
        internal AllocatedCase Dequeue()
        {
            if (Count == 0)
            {
                return(default(AllocatedCase));
            }

            AllocatedCase ac = _queue.Dequeue();

            _timeOfEnqueuing.Remove(ac);
            return(ac);
        }
示例#5
0
        //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);
        }
示例#6
0
        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);
        }
示例#7
0
        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;
        }
示例#9
0
        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);
        }
示例#10
0
 internal void Enqueue(Hour currentHour, AllocatedCase allocatedCase)
 {
     _queue.Enqueue(currentHour, allocatedCase);
 }
示例#11
0
 internal abstract void AddToCirculationQueue(AllocatedCase allocatedCase, Hour currentHour);
示例#12
0
 internal void Add(AllocatedCase ac)
 {
     _list.Add(ac);
 }
示例#13
0
 internal override void AddToCirculationQueue(AllocatedCase allocatedCase, Hour currentHour)
 {
     _registrar.AddToCirculation(currentHour, allocatedCase);
 }
示例#14
0
 internal void ProcessIncomingCase(Hour currentHour, AllocatedCase allocatedCase)
 {
     _incoming.Enqueue(currentHour, allocatedCase);
 }
示例#15
0
 internal void EnqueueForWorker(Hour currentHour, CaseWorker nextWorker, AllocatedCase allocatedCase)
 {
     _boardQueue.EnqueueForMember(currentHour, nextWorker, allocatedCase);
 }
示例#16
0
 internal abstract void Schedule(Hour currentHour, AllocatedCase allocatedCase);
示例#17
0
 internal void EnqueueForMember(Hour currentHour, CaseWorker worker, AllocatedCase allocatedCase)
 {
     _checkMemberIsRegistered(worker.Member);
     _memberQueues[worker.Member].Enqueue(currentHour, allocatedCase, worker.Role);
 }
示例#18
0
 internal void ScheduleOP(Hour currentHour, AllocatedCase allocatedCase)
 {
     _opSchedule.Schedule(currentHour, allocatedCase);
 }
示例#19
0
 internal void Enqueue(Hour hour, AllocatedCase t)
 {
     _queue.Enqueue(t);
     _timeOfEnqueuing[t] = hour;
 }
示例#20
0
 internal void Enqueue(Hour currentHour, AllocatedCase ac, WorkerRole role)
 {
     _queues[role].Enqueue(currentHour, ac);
 }
示例#21
0
 internal void ScheduleOP(Hour currentHour, AllocatedCase allocatedCase)
 {
     _registrar.ScheduleOP(currentHour, allocatedCase);
 }
示例#22
0
 internal abstract void Add(Hour hour, AllocatedCase allocatedCase);
示例#23
0
 internal void AddToCirculation(Hour currentHour, AllocatedCase allocatedCase)
 {
     _circulation.Enqueue(currentHour, allocatedCase);
 }