Exemple #1
0
        public CNS(ICreature cr)
        {
            myCr = cr;

              //формировать секции
              int seCount = cr.SectionsCount();
              for (int seIndex = 0; seIndex < seCount; ++seIndex)
              {
            ISection sec = cr.GetSection(seIndex);
            Section section = new Section(sec, this);
            sections.Add(section);
              }

              reactAlg = new ReactAlg(sections);
        }
Exemple #2
0
        public Predictor(Section mySect, Sensor mySens)
        {
            this.mySect = mySect;
              this.mySens = mySens;
              this.entries = new List<PredictorEntry>();
              this.predictedValue = mySens.CurrentValue;
              this.predictedForTick = int.MaxValue;

              List<Interval> intervals = new List<Interval>();
              intervalsCount = mySect.GetEffectorsCount() + mySect.GetSensorsCount() + mySect.GetTSensorsCount();

              for (int i = 0; i < intervalsCount; ++i)
            intervals.Add(
              new Interval()
              );

              PredictorEntry pe = new PredictorEntry();
              pe.intervals = intervals;
              pe.predictor = new CP_Const(mySens.CurrentValue);

              entries.Add(pe);
        }
Exemple #3
0
 public Sensor(int index, Section mySec, bool thisIsTarget)
     : base(index, mySec)
 {
     this.thisIsTarget = thisIsTarget;
 }
Exemple #4
0
 public Effector(int index, Section mySec)
     : base(index, mySec)
 {
 }
Exemple #5
0
 public Cell(int index, Section mySec)
 {
     this.index = index;
       this.mySec = mySec;
 }
Exemple #6
0
 /// <summary>
 /// Заданные значения эффектора
 /// </summary>
 /// <param name="mySec">Секция эффектора</param>
 /// <param name="effectorIndex">Индекс эффектора</param>
 /// <param name="bottom">Нижнее значение</param>
 /// <param name="top">Верхнее значение</param>
 public EffInterval(Section mySec, int effectorIndex, double bottom, double top)
 {
     this.bottom = bottom;
     this.top = top;
     this.mySec = mySec;
     this.effectorIndex = effectorIndex;
 }