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

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

public getLocationState ( String location ) : VacuumEnvironment.LocationState
location String
Результат VacuumEnvironment.LocationState
        public VacuumEnvironment.LocationState getLocationState(String location)
        {
            return state.get(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);
        }