forked from CovertLab/WholeCell
-
Notifications
You must be signed in to change notification settings - Fork 0
/
runSimulation.m
33 lines (28 loc) · 937 Bytes
/
runSimulation.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
% Executes whole cell simulation.
%
% Author: Jonathan Karr, [email protected]
% Author: Jared Jacobs, [email protected]
% Affilitation: Covert Lab, Department of Bioengineering, Stanford University
% Last updated: 1/9/2011
function sim = runSimulation(varargin)
%parse options
if nargin >= 1 && isstruct(varargin{1})
options = varargin{1};
else
validateattributes(numel(varargin), {'numeric'}, {'even'});
options = struct(varargin{:});
end
if isfield(options, 'logToDisk') && ischar(options.logToDisk)
options.logToDisk = strcmp(options.logToDisk, 'true');
end
if isfield(options, 'logToDb') && ischar(options.logToDb)
options.logToDb = strcmp(options.logToDb, 'true');
end
if isfield(options, 'runner')
runnerClassName = options.runner;
else
runnerClassName = 'SimulationRunner';
end
%run simulation
runner = edu.stanford.covert.cell.sim.runners.(runnerClassName)(options);
sim = runner.run();