Esempio n. 1
0
        public void executeTrial(Randomizer r)
        {
            currentState   = mdp.getInitialState();
            currentReward  = mdp.getRewardFor(mdp.getInitialState());
            previousState  = default(STATE_TYPE);
            previousAction = default(ACTION_TYPE);
            MDPPerception <STATE_TYPE> perception = new MDPPerception <STATE_TYPE>(
                currentState, currentReward);
            ACTION_TYPE action = default(ACTION_TYPE);

            do
            {
                action = decideAction(perception);
                if (action != null)
                {
                    perception = execute(action, r);
                }
            } while (action != null);
        }
Esempio n. 2
0
 public MDPAgent(MDP <STATE_TYPE, ACTION_TYPE> mdp)
 {
     this.mdp           = mdp;
     this.currentState  = mdp.getInitialState();
     this.currentReward = mdp.getRewardFor(currentState);
 }