Allow current.GetScore() to return values lower than -999,999
|Opened on:||Sunday, April 5, 2020 - 03:08|
|Last modified:||Sunday, April 5, 2020 - 03:08|
Consider a Lua function that continuously wiggles the protein until it's no longer showing any significant improvement:
if (min_improvement == nil or min_improvement == 0) then
min_improvement = 1;
wiggle_improvement = nil;
score_before_wiggle = current.GetScore();
wiggle_improvement = current.GetScore() - score_before_wiggle;
print("Wiggle improvement: " .. wiggle_improvement);
until (wiggle_improvement < min_improvement)
This function normally works great, but it runs into a problem when the protein's score is below -999,999 because current.GetScore() returns -999,999 instead.
So, for example, let's say that the protein's score is -1,753,728 and one wiggle iteration improves that score to -1,234,168. That's a significant improvement, but current.GetScore() returns -999,999 for both values, so the function thinks that no improvement has been made and stops wiggling.
It would be nice if current.GetScore() reported the true value rather than the capped value. The capped value makes some sense for the GUI so that the text doesn't overflow, but it serves zero purpose when Lua scripting.