src/core/reinforcement/policy/executablepolicy/MCTSPolicy.java
private void updateActionProbabilities(Matrix policyValueMatrix, HashSet<Integer> availableActions) {
            for (Integer action : availableActions) {
                double actionValue = policyValueMatrix.getValue(action, 0);
                if (actions.containsKey(action)) actions.get(action).setActionProbability(actionValue);
                else actions.put(action, new Action(this, action, actionValue));
            }
            double cumulativeValue = 0;
            for (Action action : actions.values()) cumulativeValue += action.getActionProbability();
            if (cumulativeValue > 0) for (Action action : actions.values()) action.setActionProbability(action.getActionProbability() / cumulativeValue);
        }
/**
         * Updates action probabilities for state.
         *
         * @param policyValueMatrix current state value matrix.
         * @param availableActions available actions in current state
         */
Updates action probabilities for state.

@param policyValueMatrix current state value matrix.
@param availableActions available actions in current state
Updates action probabilities for state . @param policyValueMatrix current state value matrix . @param availableActions available actions in current state
private void updateActionProbabilities(Matrix policyValueMatrix, HashSet<Integer> availableActions) {
            for (Integer action : availableActions) {
                double actionValue = policyValueMatrix.getValue(action, 0);
                if (actions.containsKey(action)) actions.get(action).setActionProbability(actionValue);
                else actions.put(action, new Action(this, action, actionValue));
            }
            double cumulativeValue = 0;
            for (Action action : actions.values()) cumulativeValue += action.getActionProbability();
            if (cumulativeValue > 0) for (Action action : actions.values()) action.setActionProbability(action.getActionProbability() / cumulativeValue);
        }
private void updateActionProbabilities ( Matrix policyValueMatrix , HashSet < Integer > availableActions ) { for ( Integer action : availableActions ) { double actionValue = policyValueMatrix . getValue ( action , 0 ) ; if ( actions . containsKey ( action ) ) actions . get ( action ) . setActionProbability ( actionValue ) ; else actions . put ( action , new Action ( this , action , actionValue ) ) ; } double cumulativeValue = 0 ; for ( Action action : actions . values ( ) ) cumulativeValue += action . getActionProbability ( ) ; if ( cumulativeValue > 0 ) for ( Action action : actions . values ( ) ) action . setActionProbability ( action . getActionProbability ( ) / cumulativeValue ) ; }
Updates action probabilities for state.
Updates action probabilities for state .