algorithmic modeling for Rhino
I am testing a simple script that would allow me to manually input fitness scores into Galapagos for each iteration of the genome (see the attached image and c# code). It seems simple, but I am running into a major problem, Galapagos is not registering my input until the iteration after the genome I am scoring occurs. For example, if the slider is at "7" and i want to score that as a 9, Galapagos won't register it and instead read whatever the output was before I scored the iteration. When the slider moves to something else in the next iteration, it will get the score of 9 that I just input.
Is there a way that I can ensure that Galapagos doesn't read the fitness value until after I have input the value?
private void RunScript(double x, ref object A)
{
if(x != previous){
Rhino.Input.RhinoGet.GetNumber("Enter Score", false, ref score);
previous = x;
}
A = score;
}
private static double previous = -1;
private static double score = 5;
Tags:
Welcome to
Grasshopper
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
Added by Parametric House 0 Comments 0 Likes
© 2024 Created by Scott Davidson. Powered by