forked from grussorusso/line
-
Notifications
You must be signed in to change notification settings - Fork 0
/
lineDefaults.m
85 lines (81 loc) · 2.52 KB
/
lineDefaults.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
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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
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 = struct();
options.force = false;
options.hide_immediate = true; % hide immediate transitions if possible
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';
options.remote = false;
options.remote_endpoint = '127.0.0.1';
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.config.highvar = 'none';
options.iter_max = 200;
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 = true;
options.iter_tol = 5e-2;
options.iter_max = 100;
case 'LQNS'
options = EnsembleSolver.defaultOptions();
options.timespan = [Inf,Inf];
options.keep = true;
case 'MAM'
options.iter_max = 100;
options.timespan = [Inf,Inf];
case 'MVA'
options.iter_max = 1000;
options.config.highvar = 'none';
options.config.multiserver = 'default';
options.config.np_priority = 'default';
case 'NC'
options.samples = 1e5;
options.timespan = [Inf,Inf];
options.config.highvar = 'interp';
case 'SSA'
options.timespan = [0,Inf];
options.verbose = true;
end
end