LINE Solver
MATLAB API documentation
Loading...
Searching...
No Matches
isCatastropheSignal.m
1function bool = isCatastropheSignal(sn, class)
2% BOOL = ISCATASTROPHESIGNAL(SN, CLASS)
3%
4% True if signal class CLASS empties a station on arrival. The signaltype is
5% consulted alongside the iscatastrophe flag so that the two encodings of a
6% catastrophe cannot disagree (SolverMAM applies the same test).
7
8bool = false;
9if isfield(sn, 'iscatastrophe') && ~isempty(sn.iscatastrophe) && numel(sn.iscatastrophe) >= class ...
10 && sn.iscatastrophe(class)
11 bool = true;
12 return
13end
14if isfield(sn, 'signaltype') && ~isempty(sn.signaltype) && numel(sn.signaltype) >= class
15 st = sn.signaltype{class};
16 if ~isempty(st) && ~(isnumeric(st) && any(isnan(st))) && st == SignalType.CATASTROPHE
17 bool = true;
18 end
19end
20end
Definition Station.m:245