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); }
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); }
public Sensor(int index, Section mySec, bool thisIsTarget) : base(index, mySec) { this.thisIsTarget = thisIsTarget; }
public Effector(int index, Section mySec) : base(index, mySec) { }
public Cell(int index, Section mySec) { this.index = index; this.mySec = mySec; }
/// <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; }