Grasshopper

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;

Views: 1488

Replies to This Discussion

I am interested to do a similar thing, mainly I wish that the user can rate the sample gene. Did you manage to find a solution to this?

RSS

About

Translate

Search

Videos

  • Add Videos
  • View All

© 2024   Created by Scott Davidson.   Powered by

Badges  |  Report an Issue  |  Terms of Service