src/core/reinforcement/agent/AgentFactory.java
public static Agent createAgent(Agent agent, boolean sharedPolicyFunctionEstimator, boolean sharedValueFunctionEstimator, boolean sharedMemory) throws MatrixException, AgentException, IOException, DynamicParamException, ClassNotFoundException {
        if (agent instanceof AbstractPolicyGradient) return ((AbstractPolicyGradient)agent).reference(sharedPolicyFunctionEstimator, sharedValueFunctionEstimator, sharedMemory);
        if (agent instanceof AbstractQLearning) return ((AbstractQLearning)agent).reference(sharedValueFunctionEstimator, sharedMemory);
        throw new AgentException("Unknown agent type. Unable to create reference for agent.");
    }
/**
     * Returns reference to agent.
     *
     * @param agent reference agent.
     * @param sharedPolicyFunctionEstimator if true shared policy function estimator is used otherwise new policy function estimator is created.
     * @param sharedValueFunctionEstimator if true shared value function estimator is used between value functions otherwise separate value function estimator is used.
     * @param sharedMemory if true shared memory is used between estimators.
     * @return reference to algorithm.
     * @throws IOException throws exception if creation of target value FunctionEstimator fails.
     * @throws ClassNotFoundException throws exception if creation of target value FunctionEstimator fails.
     * @throws DynamicParamException throws exception if parameter (params) setting fails.
     * @throws MatrixException throws exception if neural network has less output than actions.
     * @throws AgentException throws exception if state action value function is applied to non-updateable policy.
     */
Returns reference to agent.

@param agent reference agent.
@param sharedPolicyFunctionEstimator if true shared policy function estimator is used otherwise new policy function estimator is created.
@param sharedValueFunctionEstimator if true shared value function estimator is used between value functions otherwise separate value function estimator is used.
@param sharedMemory if true shared memory is used between estimators.
@return reference to algorithm.
@throws IOException throws exception if creation of target value FunctionEstimator fails.
@throws ClassNotFoundException throws exception if creation of target value FunctionEstimator fails.
@throws DynamicParamException throws exception if parameter (params) setting fails.
@throws MatrixException throws exception if neural network has less output than actions.
@throws AgentException throws exception if state action value function is applied to non-updateable policy.
Returns reference to agent . @param agent reference agent . @param sharedPolicyFunctionEstimator if true shared policy function estimator is used otherwise new policy function estimator is created . @param sharedValueFunctionEstimator if true shared value function estimator is used between value functions otherwise separate value function estimator is used . @param sharedMemory if true shared memory is used between estimators . @return reference to algorithm . @throws IOException throws exception if creation of target value FunctionEstimator fails . @throws ClassNotFoundException throws exception if creation of target value FunctionEstimator fails . @throws DynamicParamException throws exception if parameter ( params ) setting fails . @throws MatrixException throws exception if neural network has less output than actions . @throws AgentException throws exception if state action value function is applied to non - updateable policy .
public static Agent createAgent(Agent agent, boolean sharedPolicyFunctionEstimator, boolean sharedValueFunctionEstimator, boolean sharedMemory) throws MatrixException, AgentException, IOException, DynamicParamException, ClassNotFoundException {
        if (agent instanceof AbstractPolicyGradient) return ((AbstractPolicyGradient)agent).reference(sharedPolicyFunctionEstimator, sharedValueFunctionEstimator, sharedMemory);
        if (agent instanceof AbstractQLearning) return ((AbstractQLearning)agent).reference(sharedValueFunctionEstimator, sharedMemory);
        throw new AgentException("Unknown agent type. Unable to create reference for agent.");
    }
public static Agent createAgent ( Agent agent , boolean sharedPolicyFunctionEstimator , boolean sharedValueFunctionEstimator , boolean sharedMemory ) throws MatrixException , AgentException , IOException , DynamicParamException , ClassNotFoundException { if ( agent instanceof AbstractPolicyGradient ) return ( ( AbstractPolicyGradient ) agent ) . reference ( sharedPolicyFunctionEstimator , sharedValueFunctionEstimator , sharedMemory ) ; if ( agent instanceof AbstractQLearning ) return ( ( AbstractQLearning ) agent ) . reference ( sharedValueFunctionEstimator , sharedMemory ) ; throw new AgentException ( "Unknown agent type. Unable to create reference for agent." ) ; }
Returns reference to agent.
Returns reference to agent .