src/core/reinforcement/memory/SumTree.java
void add(StateTransition stateTransition) {
        stateTransitionNodeHashMap.remove(currentLeafNode.stateTransition);
        currentLeafNode.stateTransition = stateTransition;
        stateTransitionNodeHashMap.put(stateTransition, currentLeafNode);
        stateTransition.priority = maxPriority = Math.max(maxPriority, stateTransition.priority);
        currentLeafNode.updatePriority(maxPriority);
        currentLeafNode = currentLeafNode.nextLeafNode;
    }
/**
     * Adds state transition in sum tree at the location of current node and shifts current node one forward.
     * Updates total priority of sum tree according to priority of added state transition.
     *
     * @param stateTransition state transition to be added.
     */
Adds state transition in sum tree at the location of current node and shifts current node one forward.
Updates total priority of sum tree according to priority of added state transition.

@param stateTransition state transition to be added.
Adds state transition in sum tree at the location of current node and shifts current node one forward . Updates total priority of sum tree according to priority of added state transition . @param stateTransition state transition to be added .
void add(StateTransition stateTransition) {
        stateTransitionNodeHashMap.remove(currentLeafNode.stateTransition);
        currentLeafNode.stateTransition = stateTransition;
        stateTransitionNodeHashMap.put(stateTransition, currentLeafNode);
        stateTransition.priority = maxPriority = Math.max(maxPriority, stateTransition.priority);
        currentLeafNode.updatePriority(maxPriority);
        currentLeafNode = currentLeafNode.nextLeafNode;
    }
void add ( StateTransition stateTransition ) { stateTransitionNodeHashMap . remove ( currentLeafNode . stateTransition ) ; currentLeafNode . stateTransition = stateTransition ; stateTransitionNodeHashMap . put ( stateTransition , currentLeafNode ) ; stateTransition . priority = maxPriority = Math . max ( maxPriority , stateTransition . priority ) ; currentLeafNode . updatePriority ( maxPriority ) ; currentLeafNode = currentLeafNode . nextLeafNode ; }
Adds state transition in sum tree at the location of current node and shifts current node one forward.
Adds state transition in sum tree at the location of current node and shifts current node one forward .