schrum2 / EvoCraft-SCOPE

0 stars 0 forks source link

Command line parameter for fitness function #39

Closed schrum2 closed 2 years ago

schrum2 commented 2 years ago

Once #38 is complete, make a command line parameter FITNESS_FUNCTION that allows the user to specify the fitness function from the command line. We want this to be as general as possible. The type of the parameter will be string, but what we want is to have a way of taking that string and converting it into the Python function. We will require that any designated fitness function exist inside of the fitness_functions module. You might have to look around on how to get a Python function given its name as a string.

alejmedinajr commented 2 years ago

Added FITNESS_FUNCTIONas a command line parameter, and it only checks if the string passed exists if INTERACTIVE_EVOLUTION is false. I am going to go ahead and close this issue for now just because it seems like issue #41 expands on what was done with this issue.

schrum2 commented 2 years ago

Check that the fitness function is valid in main.py after it is loaded, and give a "nice" error message instead of a crash

alejmedinajr commented 2 years ago

Now there is a try/except block to display a nicer message ('____ is not a valid fitness function name.') when a invalid fitness function name is used.