public override void InvokeReal()
        {
            SimActor TheBot = (SimActor)this.TheBot;

            TimeRemaining = rand.Next(1, 3); // one to tree cycles
            while (TimeRemaining-- > 0)
            {
                String use = TypeUsage.UsageName;
                TheBot.Approach(Victem, 5);
                TheBot.Debug(ToString());
                CurrentTopic = TheBot.LastAction;
                TheBot.TalkTo(Victem, CurrentTopic);
                Thread.Sleep(8000);
                //User.ApplyUpdate(use, simObject);
            }
            BotNeeds CurrentNeeds = (BotNeeds)TheBot["CurrentNeeds"];
            BotNeeds needsBefore  = CurrentNeeds.Copy();
            BotNeeds simNeeds     = TypeUsage.ChangeActual;

            //TODO rate interaction
            CurrentNeeds.AddFrom(simNeeds);
            CurrentNeeds.SetRange(0.0F, 100.0F);
            BotNeeds difNeeds = CurrentNeeds.Minus(needsBefore);

            TheBot.Debug(ToString() + " => " + difNeeds.ShowNonZeroNeeds());
        }
 public float TotalSideEffect(BotNeeds bn)
 {
     bn = bn.Copy();
     bn.AddFrom(this);
     bn.SetRange(0f, 100f);
     return(bn.Total());
 }
예제 #3
0
        public float RateIt(BotNeeds from, SimTypeUsage use)
        {
            if (use == null)
            {
                return(-100f);
            }
            BotNeeds sat = GetUsagePromise(use.UsageName).Copy();

            sat.AddFrom(from);
            sat.SetRange(0.0F, 100.0F);
            return(sat.Total());
        }
예제 #4
0
 public float TotalSideEffect(BotNeeds bn) {
     bn = bn.Copy();           
     bn.AddFrom(this);
     bn.SetRange(0f, 100f);
     return bn.Total();
 }