src/core/reinforcement/value/PlainValueFunction.java
protected void updateBaseline(TreeSet<StateTransition> stateTransitions) {
        if (!useBaseline) return;

        double mean = 0;
        for (StateTransition stateTransition : stateTransitions) mean += stateTransition.tdTarget;
        mean /= stateTransitions.size();

        averageMean = averageMean == Double.NEGATIVE_INFINITY ? mean : tau * averageMean + (1 - tau) * mean;

        double std = 0;
        for (StateTransition stateTransition : stateTransitions) std += Math.pow(stateTransition.tdTarget - mean, 2);
        std = Math.sqrt(std / (stateTransitions.size() - 1));

        averageStandardDeviation = averageStandardDeviation == Double.NEGATIVE_INFINITY ? std : tau * averageStandardDeviation + (1 - tau) * std;

        for (StateTransition stateTransition : stateTransitions) stateTransition.tdTarget = (stateTransition.tdTarget - averageMean) / averageStandardDeviation;
    }
/**
     * Updates baseline values for state transitions.
     *
     * @param stateTransitions state transitions.
     */
Updates baseline values for state transitions.
@param stateTransitions state transitions.
Updates baseline values for state transitions . @param stateTransitions state transitions .
protected void updateBaseline(TreeSet<StateTransition> stateTransitions) {
        if (!useBaseline) return;
        double mean = 0;
        for (StateTransition stateTransition : stateTransitions) mean += stateTransition.tdTarget;
        mean /= stateTransitions.size();
        averageMean = averageMean == Double.NEGATIVE_INFINITY ? mean : tau * averageMean + (1 - tau) * mean;
        double std = 0;
        for (StateTransition stateTransition : stateTransitions) std += Math.pow(stateTransition.tdTarget - mean, 2);
        std = Math.sqrt(std / (stateTransitions.size() - 1));
        averageStandardDeviation = averageStandardDeviation == Double.NEGATIVE_INFINITY ? std : tau * averageStandardDeviation + (1 - tau) * std;
        for (StateTransition stateTransition : stateTransitions) stateTransition.tdTarget = (stateTransition.tdTarget - averageMean) / averageStandardDeviation;
    }
protected void updateBaseline ( TreeSet < StateTransition > stateTransitions ) { if ( ! useBaseline ) return ; double mean = 0 ; for ( StateTransition stateTransition : stateTransitions ) mean += stateTransition . tdTarget ; mean /= stateTransitions . size ( ) ; averageMean = averageMean == Double . NEGATIVE_INFINITY ? mean : tau * averageMean + ( 1 - tau ) * mean ; double std = 0 ; for ( StateTransition stateTransition : stateTransitions ) std += Math . pow ( stateTransition . tdTarget - mean , 2 ) ; std = Math . sqrt ( std / ( stateTransitions . size ( ) - 1 ) ) ; averageStandardDeviation = averageStandardDeviation == Double . NEGATIVE_INFINITY ? std : tau * averageStandardDeviation + ( 1 - tau ) * std ; for ( StateTransition stateTransition : stateTransitions ) stateTransition . tdTarget = ( stateTransition . tdTarget - averageMean ) / averageStandardDeviation ; }
Updates baseline values for state transitions.
Updates baseline values for state transitions .