% Author: Elsa W. Birch, ewbirch@stanford.edu, Covert Lab - Stanford Bioengineering
% Date: 4/24/2011
% Version: associated with production of the figures for Birch et al. 2012
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
%
% Summary: Fill simulation method options with handle format functions to call
% 
%
% Inputs: simulation with methods specified, without specified handles
%
% Outputs: simulation with methods handles specified
%
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 
%
% Notes: 
%
%
% - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
function simulationWithMethods = FBA_EB_simulationSetMethods(simulation)

for iOrgMeth = 1 : simulation.nOrganism
    
    simulation.( simulation.organismList{ iOrgMeth } ).methods.initializerHandle = ...
        eval( ['@',simulation.setup.initializerHandles{ iOrgMeth }] );
    
    simulation.( simulation.organismList{ iOrgMeth } ).methods.fluxConstraintHandle = ...
        eval( ['@',simulation.setup.fluxConstraintHandles{ iOrgMeth }] );
    
    simulation.( simulation.organismList{ iOrgMeth } ).methods.accumulationSetHandle = ...
        eval( ['@',simulation.setup.accumulationSetHandles{ iOrgMeth }] );
    
    simulation.( simulation.organismList{ iOrgMeth } ).methods.viralConstraintHandle = ...
        eval( ['@',simulation.setup.viralConstraintHandles{ iOrgMeth }] );
    
    simulation.( simulation.organismList{ iOrgMeth } ).methods.viralODEsolverHandle = ...
        eval( ['@',simulation.setup.viralODEsolverHandles{ iOrgMeth }] );
    
    %
    simulation.( simulation.organismList{ iOrgMeth } ).methods.viralRequestHandle = ...
        eval( ['@',simulation.setup.viralRequestHandle{ iOrgMeth }] );

    %
    simulation.( simulation.organismList{ iOrgMeth } ).methods.modularSingleStepHandle = ...
        eval( ['@',simulation.setup.modularSingleStepHandle{ iOrgMeth }] );
    
    simulation.( simulation.organismList{ iOrgMeth } ).methods.viralReferenceRunFlag = ...
        simulation.setup.viralReferenceRunFlag( iOrgMeth );
    
    
end % for iOrgMeth

simulationWithMethods = simulation;
