public void Initialize(NegotiationDomain domain, SideConfig strategyConfig, String opponentSide, INegotiationClient client) { Client = client; client.OfferReceivedEvent += client_OfferReceivedEvent; client.NegotiationEndedEvent += client_NegotiationEndedEvent; }
// Token: 0x060001C1 RID: 449 RVA: 0x00024528 File Offset: 0x00022728 private void CallConfig_Click(object sender, EventArgs e) { using (SideConfig sideConfig = new SideConfig()) { sideConfig.ShowDialog(); } }
private NegotiationTutorialModel CreateTutorialModel(string id) { NegotiationEngine engine = NegotiationManager.OnGoingNegotiations[id]; SideConfig config = engine.HumanConfig; NegotiationSideDescription desc = engine.Domain.OwnerVariantDict[config.Side][config.Variant]; int optoutend = engine.Domain.CalculateOptoutScore(config, NegotiationManager.TotalRounds); return(new NegotiationTutorialModel { TutorialId = id, Questions = new List <QuestionModel> { new QuestionModel { Question = "Whose side are you playing in the negotiation?", Options = engine.Domain.OwnerVariantDict.Keys.ToList(), ActualAnswer = config.Side }, new QuestionModel { Question = "If the same agreement was reached in round 3 or in round 6, which of the following is correct?", Options = new List <string> { "They have the same score.", "Round 3 will have a higher score.", "Round 6 will have a higher score" }, ActualAnswer = "Round 3 will have a higher score." }, new QuestionModel { Question = "What is your score if no agreement had been reached by the end of the last round?", Options = new List <string> { "0", "No score - you have lost the negotiation", optoutend.ToString() }, ActualAnswer = optoutend.ToString() }, new QuestionModel { Question = "What is the meaning of \"opting out\"?", Options = new List <string> { "It means that the other side won the negotiation.", "It means you get a predetermined amount of points minus the time decrease." }, ActualAnswer = "It means you get a predetermined amount of points minus the time decrease." } } }); }
public virtual void Initialize(NegotiationDomain domain, SideConfig strategyConfig, String opponentSide, INegotiationClient client) { Domain = domain; StrategyConfig = strategyConfig; Client = client; OpponentSide = opponentSide; Client.NegotiationStartedEvent += OnNegotiationStartedEvent; Client.NegotiationEndedEvent += OnNegotiationEndedEvent; Client.OfferReceivedEvent += OnOfferReceivedEventInner; Client.TimePassedEvent += OnTimePassedEventInner; Client.OpponentAcceptedOfferEvent += OnOpponentAcceptedOfferEvent; CalculateOffers(); }
public override void Initialize(NegotiationDomain domain, SideConfig strategyConfig, string opponentSide, INegotiationClient client) { if (domain.NumberOfRounds != 15) { throw new ArgumentException("This strategy has been optimized for 15 rounds", "domain"); } if (domain.OwnerVariantDict[opponentSide].Keys.Count != 3) { throw new ArgumentException("This strategy has been optimized for 3 opponent variants", "domain"); } base.Initialize(domain, strategyConfig, opponentSide, client); FScoreOffersByUtility = BestFScoreUtilityOffers.Values.OrderByDescending(x => x.Utility).ToList(); }
protected double CalculateUtility(IEnumerable <KeyValuePair <String, String> > offer, SideConfig config) { var sideDesc = Domain.GetSideDescription(config); return(offer.Aggregate(0.0, (sum, x) => sum + sideDesc.Topics[x.Key].Options[x.Value].Score)); }