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 Section(ISection sec, CNS cns) { myCns = cns; mySec = sec; //получить эффекторы int effCount = sec.GetEffectorsCount(); effsMem = new List<double>[effCount]; for (int effInd = 0; effInd < effCount; ++effInd) { effsMem[effInd] = new List<double>(); Effector eff = new Effector(effInd, this); effs.Add(eff); } //получить сенсоры int sensCount = sec.GetSensorsCount(); sensorsMem = new List<double>[sensCount]; for (int sensInd = 0; sensInd < sensCount; ++sensInd) { sensorsMem[sensInd] = new List<double>(); Sensor sens = new Sensor(sensInd, this, false); sensors.Add(sens); } //получить целевые сенсоры int tSensCount = sec.GetGoalSensorsCount(); tSensorsMem = new List<double>[tSensCount]; for (int tSensInd = 0; tSensInd < tSensCount; ++tSensInd) { tSensorsMem[tSensInd] = new List<double>(); Sensor tSens = new Sensor(tSensInd, this, true); tSensors.Add(tSens); } }