Signals encapsulate the payload to be returned. The Signal object maintains a list of valid values (EnumeratedSignal) or the range it can vary (BoundedSignal). Refer to section 2.3 for more information on signals. The value is randomly selected in the initialization phase and can only be changed via mutation.
BoundedSignal objects can yield values between an interval.
The constructor of BoundedSignal.
| Argument | Description |
|---|---|
lowerBound |
The lower bound of the interval. |
upperBound |
The upper bound of the interval. |
returnType |
Can be either int, float, or double. |
- If the
lowerBoundequals theupperBound, the framework will supress the forming of aValueobject in the right-hand side.
% An integer between -5 and 5
bs = BoundedSignal(-5, 5, 'int');
bs.init();
disp(bs.signal);
% A decimal value between -5 and 5
BoundedSignal(-5, 5, 'double');
bs.init();
disp(bs.signal);EnumeratedSignals are objects that can yield enumerated values.
The constructor of EnumeratedSignals.
| Argument | Description |
|---|---|
allowedValues |
A cell of values. |
% Yield either 'Buy', 'Hold', or 'Sell'.
% In a real world application, it is recommended to replace the three strings with integers for better performance.
es = EnumeratedSignal({'Buy', 'Hold', 'Sell'});
es.init();
disp(es.signal);This project, including the documentation, is licensed under the MIT license. Copyright (c) 2022 Bohui WU.