public Cell CreateCell(float x, float z, float angle, bool smart)
    {
        if (smart)
        {
            return(new Cell(new SmartInternals(x, z, 1, v, smartnessFactor)));
        }
        ICellRegulation regulator;

        switch (regulatorType)
        {
        case RegulatorType.ODE:
            regulator = new ODERegulation();
            break;

        case RegulatorType.Delta:
            regulator = new DeltaRegulation();
            break;

        default:
            regulator = new DeltaRegulation();
            break;
        }

        if (iterations == 0)
        {
            return(new Cell(new Internals(x, z, v, dT, angle, regulator)));
        }
        else
        {
            return(new Cell(new ForwardInternals(x, z, v, dT, angle, regulator, iterations)));
        }
    }
Example #2
0
    public override State GetInternalState()
    {
        State state = new State();

        if (this.regulator is ODERegulation)
        {
            ODERegulation r = (ODERegulation)this.regulator;
            state.yp = r.GetYP();
            state.ap = r.GetAP();
            state.bp = r.GetBP();
            state.m  = r.GetM();
            state.l  = r.GetL();
        }
        return(state);
    }