예제 #1
0
파일: CNS.cs 프로젝트: slavik37/project-cns
        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);
        }
예제 #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);
        }
예제 #3
0
파일: CNS.cs 프로젝트: slavik37/project-cns
 public Sensor(int index, Section mySec, bool thisIsTarget)
     : base(index, mySec)
 {
     this.thisIsTarget = thisIsTarget;
 }
예제 #4
0
파일: CNS.cs 프로젝트: slavik37/project-cns
 public Effector(int index, Section mySec)
     : base(index, mySec)
 {
 }
예제 #5
0
파일: CNS.cs 프로젝트: slavik37/project-cns
 public Cell(int index, Section mySec)
 {
     this.index = index;
       this.mySec = mySec;
 }
예제 #6
0
파일: CNS.cs 프로젝트: slavik37/project-cns
 /// <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;
 }