VacuumCleaner.Env.Environment.DirtAmount C# (CSharp) Method

DirtAmount() public method

public DirtAmount ( int x, int y ) : int
x int
y int
return int
        public int DirtAmount(int x, int y)
        {
            if (maze_[x][y] == OBSTACLE) return 0;
                else return maze_[x][y];
        }

Usage Example

Example #1
0
        public void Eval(ActionType action, Environment env)
        {
            if (action == ActionType.actSUCK)
                consumedEnergy_ += 2;
            else if (action != ActionType.actIDLE)
                consumedEnergy_ += 1;
            cleanedDirty_ += env.getCleanedDirty;
            newDirty_ = env.getNewDirty;
            totalDirtyDegree_ += newDirty_;

            dirtyDegree_ = 0;
            for (int row = 0; row < Environment.mazeSize_; row++)
            {
                for (int col = 0; col < Environment.mazeSize_; col++)
                {
                    long da = env.DirtAmount(row, col);
                    dirtyDegree_ += da;
                }
            }
        }