Exemple #1
0
 public double getTransitionProbability(
     MDPTransition <STATE_TYPE, ACTION_TYPE> transition)
 {
     return(transitionModel.getTransitionProbability(transition
                                                     .getInitialState(), transition.getAction(), transition
                                                     .getDestinationState()));
 }
Exemple #2
0
 public void setTransitionProbability(
     MDPTransition <STATE_TYPE, ACTION_TYPE> transition,
     double probability)
 {
     transitionModel.setTransitionProbability(transition.getInitialState(),
                                              transition.getAction(), transition.getDestinationState(),
                                              probability);
 }
        public double getTransitionProbability(STATE_TYPE initialState,
                                               ACTION_TYPE action, STATE_TYPE finalState)
        {
            MDPTransition <STATE_TYPE, ACTION_TYPE> key = new MDPTransition <STATE_TYPE, ACTION_TYPE>(
                initialState, action, finalState);

            if (transitionToProbability.ContainsKey(key))
            {
                return(transitionToProbability[key]);
            }
            else
            {
                return(0.0);
            }
        }
 public void setTransitionProbability(STATE_TYPE initialState,
                                      ACTION_TYPE action, STATE_TYPE finalState, double probability)
 {
     if (!(isTerminal(initialState)))
     {
         MDPTransition <STATE_TYPE, ACTION_TYPE> t = new MDPTransition <STATE_TYPE, ACTION_TYPE>(
             initialState, action, finalState);
         if (transitionToProbability.ContainsKey(t))
         {
             transitionToProbability[t] = probability;
         }
         else
         {
             transitionToProbability.Add(t, probability);
         }
     }
 }
Exemple #5
0
        public override bool Equals(Object o)
        {
            if (o == this)
            {
                return(true);
            }
            if (!(o is MDPTransition <STATE_TYPE, ACTION_TYPE>))
            {
                return(false);
            }
            MDPTransition <STATE_TYPE, ACTION_TYPE> other = (MDPTransition <STATE_TYPE, ACTION_TYPE>)(o);// weird

            // typing
            // issue
            // work
            // out
            // later
            return(triplet.Equals(other.triplet));
        }