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

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

public setLocationState ( String location, VacuumEnvironment s ) : void
location String
s VacuumEnvironment
Результат void
        public void setLocationState(String location,
                VacuumEnvironment.LocationState s)
        {
            state.put(location, s);
        }

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