AIMA.Core.Environment.Vacuum.VacuumEnvironmentState.getAgentLocation C# (CSharp) Метод

getAgentLocation() публичный Метод

public getAgentLocation ( Agent a ) : String
a Agent
Результат String
        public String getAgentLocation(Agent a)
        {
            return agentLocations.get(a);
        }

Usage Example

Пример #1
0
        public override EnvironmentState executeAction(Agent a, Action agentAction)
        {
            if (ACTION_MOVE_RIGHT == agentAction)
            {
                envState.setAgentLocation(a, LOCATION_B);
                updatePerformanceMeasure(a, -1);
            }
            else if (ACTION_MOVE_LEFT == agentAction)
            {
                envState.setAgentLocation(a, LOCATION_A);
                updatePerformanceMeasure(a, -1);
            }
            else if (ACTION_SUCK == agentAction)
            {
                if (LocationState.Dirty == envState.getLocationState(envState
                                                                     .getAgentLocation(a)))
                {
                    envState.setLocationState(envState.getAgentLocation(a),
                                              LocationState.Clean);
                    updatePerformanceMeasure(a, 10);
                }
            }
            else if (agentAction.isNoOp())
            {
                // In the Vacuum Environment we consider things done if
                // the agent generates a NoOp.
                isDone = true;
            }

            return(envState);
        }