Randomly combination of values from two lists using Python and Dynamo

A successful day and again a small step further to a room optimization workflow.

The goal was it to combine two values out of two lists randomly. The first list includes CO2 impact values regarding wall construction materials, and the second list regarding floor materials (CO2 kg eq / m2 material). The values I have should be combined randomly, eg [LstWall x10, LstFloor x2]; [LstWall x51, LstFloo x23], hence the approach here:

1 Defining the lists as Input

ListWall = IN[0]
ListFloor = IN[1]

2. Creating first all possible pair variations

pairs = [(w,f) for w in ListWall for f in ListFloor]

3 Picking randomly pairs

choice = [random.choice(pairs) for _ in range (50)]

Actually very easy if you see it like this .. but yet took me a few days to figure it out 🙂

Keep you posted.

Cheers Jules

Genetic Algorithm tutorial

Hey nerds,

just study about genetic algorithms and how to use them for my case study. The goal is to create a digital automated workflow for optimizing apartments’ room layout. Considering three influencing measurements; 1. The room’s occupational density, indicated by individuals presence throughout the days; 2. The planetary boundary environmental budget through the absolute sustainability value; and 3. The environmental performance of construction materials through using coefficients for embodied energy and GHG emissions.

What I found here is a really good lecture about divers usages of GA, if you are interested in how to structure data before using a GA, check it out.