There will need to be a new command line parameter in args called DESIRED_BLOCK_COUNT that specifies the desired count.
The actual fitness calculation will be the DESIRED_BLOCK_COUNT minus the absolute value of the difference between the DESIRED_BLOCK_COUNT and the actual count (call type_count to get this so you can reuse code)
Make another fitness function that wants to generate a shape with a specific number of occurrences of a particular block type. Call it:
type_target(client, position_information, corner, args)
There will need to be a new command line parameter in
args
calledDESIRED_BLOCK_COUNT
that specifies the desired count.The actual fitness calculation will be the
DESIRED_BLOCK_COUNT
minus the absolute value of the difference between theDESIRED_BLOCK_COUNT
and the actual count (calltype_count
to get this so you can reuse code)