Floating Point Numbers. StrategyParameterDecimal.

Floating Point Numbers. StrategyParameterDecimal.

StrategyParameterDecimal is a wrapper for floating point numbers.

Location in the GitHub Repository.

Location in the project when opened on a PC:

The class looks as follows:

StrategyParameterDecimal - a public constructor with parameters. Initializes the initial state of the object. Takes the following data:

name - the name for the instance;

value - the default value;

start - the lower bound of the range of values;

stop - the upper bound of the range of values;

step - the step for iterating values;

tabName - the name of the tab where the parameter should be displayed;

StrategyParameterDecimal - a private parameterless constructor.

GetStringToSave - a public method. Returns a string with the parameter object settings for saving.

LoadParamFromString - a public method. Takes an array of strings with settings for the parameter and initializes the object's state.

Name - a public property of type string. Returns the displayed name of the parameter, which should be unique within the robot.

TabName - a public property of type string. Provides access to the name of the tab where the parameter will be displayed in the parameter window.

Type - a public property of type StrategyParameterType. Returns the value StrategyParameterType.Int.

ValueDecimal - a public property of type decimal. Gets or sets the current core value of the parameter. This is the value to be accessed from the robot code. This value is what the user selected in the interface.

ValueDecimalDefolt - a public property of type decimal. Returns the default value set during the object creation.

ValueDecimalStart - a public property of type decimal. Returns the lower bound of the range of values.

ValueDecimalStop - a public property of type decimal. Returns the upper bound of the range of values.

ValueDecimalStep - a public property of type decimal. Returns the step for iterating values.

ValueChange - a public event. Signals a change in the ValueInt value.

 

Example of usage.

You can check the technical examples inside the OsEngine project. For example, in CustomParamsUseBotSample:

In the constructor of this robot, you can see the creation of these variables:

Using two parameters:

View in interfaces.

In the robot's parameter window, this parameter is visible as a name + a column with a number that may have a value after the decimal point:

In the optimizer, it looks like this:

Successful algorithms!

If you have any difficulties or questions, please write to the support chat. Link