Formatting faces correctly for evolutionary solver?

Firstly id like to acknowledge i’m a bit new here and this could be a relatively big issue so im not expecting solutions but more so nudges in the right direction.

My problem lies in that i think i’ve failed to format my script in a way that my evolutionary solver (wallacei) can produce the results i want. What i need is for each face of my geometry to be tested against a list of materials that have cost and carbon values associated, ideally the solver would attach a material to each face separately in order that the total geometry cost and carbon values would be lowered. From this i would want to colour the faces depending on what the material is picked (same material represented by the same colour).

Here’s the basics of my script below, please let me know if i need to fix/ tidy/ explain anything in it, any help is valued. :slight_smile:
Colour matching.gh (25.7 KB)