public MatrixBlock CreateMatrixBlock(int a_i, int a_j, int a_iLength, int a_jLength)
    {
        MatrixBlock block = new MatrixBlock(a_i, a_j, a_iLength, a_jLength);

        m_MatrixBlocks.Add(block);
        m_m = Math.Max(m_m, a_i + a_iLength);
        return(block);
    }
 public override double GetValue(int i, int j)
 {
     for (int k = 0; k < m_MatrixBlocks.Count; k++)
     {
         MatrixBlock b = m_MatrixBlocks[k];
         if (b.i <= i && i < b.i + b.iLength && b.j <= j && j < b.j + b.jLength)
         {
             return(b.data[(i - b.i) * b.jLength + j - b.j]);
         }
     }
     return(0);
 }
Exemple #3
0
    public static Block Instantiate(string name)
    {
        Experiment.Measurement.newBlock(name);
        Block b;

        switch (name)
        {
        case "carousel":
            b = new CogBlock <CarouselTrial>();
            break;

        case "propeller":
            b = new CogBlock <PropellerTrial>();
            break;

        case "speed":
            b = new SpeedBlock();
            break;

        case "training":
            b = new CogBlock <CogTrial>();
            break;

        case "direction":
            b = new CogBlock <DirectionTrial>();
            break;

        case "trainingStability":
            b = new GenericBlock <StabilityTrial>();
            break;

        case "stabilityGreen":
            b = new GenericBlock <GreenStabilityTrial>("RESP,CRESP,AnzahlVersuche,Antwortkoordinaten,RT1,RT2,RT3,RT-Gesamt");
            break;

        case "stabilityRed":
            b = new RedStabilityBlock(2);
            break;

        case "matrix":
            b = new MatrixBlock(7, 3);
            break;

        case "vocabulary":
            b = new VocabularyBlock(13);
            break;

        case "carouselTransfer":
            b = new CogBlock <CarouselTrial>();    // orientiert an Standard carousel
            break;

        case "prt":
            b = new RedStabilityBlock(0);     // orientiert an RedStab
            break;

        case "sts":
            b = new RedStabilityBlock(1);     // orientiert an RedStab
            break;

        default:
            throw new System.ArgumentException("Tried to instantiate a block with an unknown type: '" + name + "'");
        }
        b.Config = name;
        return(b);
    }