-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathlineDefaults.m
More file actions
71 lines (68 loc) · 1.93 KB
/
lineDefaults.m
File metadata and controls
71 lines (68 loc) · 1.93 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
function options = lineDefaults(solverName)
if nargin < 1
solverName = 'Solver'; % global options unless overridden by a solver
end
%% Solver default options
options = struct();
options.cache = true;
options.cutoff = Inf;
options.config = {};
options.force = false;
options.init_sol = [];
options.iter_max = 10;
options.iter_tol = 1e-4; % convergence tolerance to stop iterations
options.tol = 1e-4; % tolerance for all other uses
options.keep = false;
options.method = 'default';
odesfun = struct();
odesfun.fastOdeSolver = Solver.fastOdeSolver;
odesfun.accurateOdeSolver = Solver.accurateOdeSolver;
odesfun.fastStiffOdeSolver = Solver.fastStiffOdeSolver;
odesfun.accurateStiffOdeSolver = Solver.accurateStiffOdeSolver;
options.odesolvers = odesfun;
if isoctave
options.samples = 5e3;
else
options.samples = 1e4;
end
options.seed = randi([1,1e6]);
options.stiff = true;
options.timespan = [Inf,Inf];
options.verbose = 1;
%% Solver-specific defaults
switch solverName
case 'CTMC'
options.timespan = [Inf,Inf];
case 'Ensemble' % Env
options.method = 'default';
options.init_sol = [];
options.iter_max = 100;
options.iter_tol = 1e-4;
options.tol = 1e-4;
options.verbose = 0;
case 'Fluid'
options = Solver.defaultOptions();
options.iter_max = 50;
options.stiff = true;
options.timespan = [0,Inf];
case 'JMT'
% use default
case 'LN'
options = EnsembleSolver.defaultOptions();
options.timespan = [Inf,Inf];
options.keep = false;
options.verbose = 2;
case 'LQNS'
options = EnsembleSolver.defaultOptions();
options.timespan = [Inf,Inf];
options.keep = false;
case 'MAM'
options.timespan = [Inf,Inf];
case 'NC'
options.samples = 1e6;
options.timespan = [Inf,Inf];
case 'SSA'
options.timespan = [0,Inf];
options.verbose = true;
end
end