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

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

public setAgentLocation ( Agent a, String location ) : void
a Agent
location String
Результат void
        public void setAgentLocation(Agent a, String location)
        {
            agentLocations.put(a, location);
        }

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);
        }