06-29-2024, 04:17 PM
So, first I will talk about the results of executing the test program code that I posted in my post No. 114.
I specifically copied parts of the code from the Rabbit AI program and pasted them into the test program code with virtually no changes.
When we first run a test program, while there is no file with saved variables in the program's folder, we first assign values to the variables ( 300, 30, Test ) and then display the data in the program window using the "OnRabbitCaptured" subroutine.
The test program displays the data shown in the first screenshot.
The test program then creates a file with saved variables "RabbitAll_variables.txt". And this is what I see in the file created on my computer:
- - - - - - -
_s_allvariablesfilepath C:\SB_Projects\Vremennoe\RabbitAll_variables.txt
number_of_sequences 300
n_sequencenumber 30
_s_dbtext number_of_caught_rabbits = 300
number_of_dead_snakes = 30
Level of training(%) = 53
Ratio = 300
number_of_sequences = 300
_stat_caughtrabbits 300
_stat_deadsnakes 30
_x 53
- - - - - - -
If I'm not mistaken, the first three lines in this file are normal.
But, starting from the fourth line, the "SaveAllVariables" method split the variable string "_s_dbText" into separate parts and turned each of these parts into a new variable that does not exist in the test program ( number_of_dead_snakes, Level of training(%), Ratio ).
In addition, the method writes the variable name "number_of_sequences" a second time and assigns it the value "= 300".
Now, during the second run, the test program reads the stored incorrect value of the variable "number_of_sequences" from the file.
In the second screenshot we see that the value of this variable is now not “300”, but “= 300”. And this changed the result of calculating the "Level of training(%)" parameter from 53% to 101%.
LitDev, if you don’t like the current test file, then tell me and I’ll make a new test file that you need. (or I'll send you all the "Rabbit AI" code)
Thank you.
I specifically copied parts of the code from the Rabbit AI program and pasted them into the test program code with virtually no changes.
When we first run a test program, while there is no file with saved variables in the program's folder, we first assign values to the variables ( 300, 30, Test ) and then display the data in the program window using the "OnRabbitCaptured" subroutine.
The test program displays the data shown in the first screenshot.
The test program then creates a file with saved variables "RabbitAll_variables.txt". And this is what I see in the file created on my computer:
- - - - - - -
_s_allvariablesfilepath C:\SB_Projects\Vremennoe\RabbitAll_variables.txt
number_of_sequences 300
n_sequencenumber 30
_s_dbtext number_of_caught_rabbits = 300
number_of_dead_snakes = 30
Level of training(%) = 53
Ratio = 300
number_of_sequences = 300
_stat_caughtrabbits 300
_stat_deadsnakes 30
_x 53
- - - - - - -
If I'm not mistaken, the first three lines in this file are normal.
But, starting from the fourth line, the "SaveAllVariables" method split the variable string "_s_dbText" into separate parts and turned each of these parts into a new variable that does not exist in the test program ( number_of_dead_snakes, Level of training(%), Ratio ).
In addition, the method writes the variable name "number_of_sequences" a second time and assigns it the value "= 300".
Now, during the second run, the test program reads the stored incorrect value of the variable "number_of_sequences" from the file.
In the second screenshot we see that the value of this variable is now not “300”, but “= 300”. And this changed the result of calculating the "Level of training(%)" parameter from 53% to 101%.
LitDev, if you don’t like the current test file, then tell me and I’ll make a new test file that you need. (or I'll send you all the "Rabbit AI" code)
Thank you.