public void Pick(IMutator mutator, ISourcer sourcer, IPnLConsumer pnLConsumer, MatchResult matchResult)
        {
            //5. Pool Result arrives and is consumed
            Mutation matchMutationLeg1 = mutator.GetMatchMutation(matchResult.Result, matchResult.PoolId);

            sourcer.Source(matchMutationLeg1);
            pnLConsumer.Consume(matchMutationLeg1);
        }
예제 #2
0
 public AllUpProcessor(IMutator mutator, IPnLConsumer pnLConsumer, ISourcer sourcer, IReducer reducer, IScenarioGenerator scenarioGenerator, IEventReceiver eventReceiver)
 {
     this.mutator           = mutator;
     this.pnLConsumer       = pnLConsumer;
     this.sourcer           = sourcer;
     this.reducer           = reducer;
     this.scenarioGenerator = scenarioGenerator;
     this.eventReceiver     = eventReceiver;
 }
        public void Generate(IMutator mutator, ISourcer sourcer, IPnLConsumer pnLConsumer, SingleTicket ticket)
        {
            //2. Produce all Ticket Mutations on PnL based on Pool's Win Scenario
            Mutation ticketMutationWin    = mutator.GetTicketMutation(ticket, Result.WIN);
            Mutation ticketMutationLoss   = mutator.GetTicketMutation(ticket, Result.LOSS);
            Mutation ticketMutationDraw   = mutator.GetTicketMutation(ticket, Result.DRAW);
            Mutation ticketMutationRefund = mutator.GetTicketMutation(ticket, Result.REFUND);

            //3. Source the events
            sourcer.Source(ticketMutationWin);
            sourcer.Source(ticketMutationLoss);
            sourcer.Source(ticketMutationDraw);
            sourcer.Source(ticketMutationRefund);

            //4. Apply the mutation on the system state
            pnLConsumer.Consume(ticketMutationWin);
            pnLConsumer.Consume(ticketMutationLoss);
            pnLConsumer.Consume(ticketMutationDraw);
            pnLConsumer.Consume(ticketMutationRefund);
        }
예제 #4
0
 public SingleProcessor(IMutator mutator, IPnLConsumer pnLConsumer, ISourcer sourcer)
 {
     this.mutator     = mutator;
     this.pnLConsumer = pnLConsumer;
     this.sourcer     = sourcer;
 }