Closed schrum2 closed 2 years ago
Also, the place_fences
method is defined inside of the MinecraftBreeder
class, but this could be turned into a function in the minecraft_structures.py
module if every reference to an instance variable via self
was turned into a parameter to the function.
Made the following modules: minecraft_structures
, neat_stagnation
, and util
. Each now contain functions or classes that were originally causing the evolve_CPPN
module to look more messy. The functions still seem to work. Although I would think that there are still some other functions that can be moved into some of these modules (such as the clear_area
function).
Go ahead and move clear_area as well
Just moved clear_area
into minecraft_structures
I reopened the issue so I could use it for a new commit with better comments.
Right now nearly all of our code is in
evolve_CPPN.py
. This makes it difficult to collaborate, and makes the code more confusing. We need to break things up a bit. For all of the code that you move into a different file, you will of course need to import that code back intoevolve_CPPN.py
and slightly change the way it is called or accessed in that file.Make a module called
neat_stagnation.py
and place theInteractiveStagnation
class there.Make a module called
minecraft_structures.py
and move theplace_number
function there.Make a module called
util.py
and place theargmax
,distance
, andscale_and_center
functions there.As you move all of these bits of code into separate files, it will be extremely important to provide proper docstrings to each one, since the purpose of each function will become less clear as they become scattered across various files. Refer to this site for style guidelines: https://www.datacamp.com/tutorial/docstrings-python