p-chambers / occ_airconics

Aircraft Configuration through Integrated Cross-disciplinary Scripting, Python package built on PythonOCC
http://occ-airconics.readthedocs.io/en/latest/index.html
BSD 3-Clause "New" or "Revised" License
14 stars 9 forks source link

Primitives in Topology_GPTools are not unique #13

Open p-chambers opened 7 years ago

p-chambers commented 7 years ago

The primitive set in the Topology_GPTools allows functions such as 'rand()' for generating a random floating point number. This behaviour results in geometries that are not consistent over multiple runs.

p-chambers commented 7 years ago

This is caused by the strong typing behaviour in DEAP: for some reason, producing a tree without these placeholder functions would give and error that looks like

IndexError: The gp.generate function tried to add a primitive of type '<type 'float'>', but there is none available.

I suspect this is a problem when mixing primitive functions and terminals at the same hierarchy level with DEAP. Will need to raise an issue with DEAP about this, or replace the tree generator function (deap.gp.genFull) with something bespoke.