Error with Karamba3D and Galapagos optimization

Dear readers,
I am new to grasshopper, and i am analysing and design a small steel truss with optimization using Galapagos. The fitness function is to minimize the mass of truss and parameters are diagonal positions (4 different positions) and height of truss in the middle (apex). However whenever i try to optimize with Galapagos, it immediately give me the apex truss height to 0m (which give it the rectangular shape. i.e.: as same height as end post) as shown in photo attached here

I wanted to hear from you if there is a way i can look for optimization with minimized height which is not turning it to 0m :frowning:

And with this, the results as shown in photo attached is getting me the minimized weight (which is obvious) and big displacement
Truss Model -18 (35.8 KB)

Waiting for your support. Thank You so much

your script shows something different than your screenshots.
However if you are only minimizing for weight then of course the results will always be 0 height, as this will give you the minimum structural height. you should also consider displacement in your fitness value.

Thanks for your response, I appreciate.

And about considering minimizing weight and displacement how can you do that? like whenever i use this arrow for fitness it allows me only one value (like if i choose weight and it does not allow displacement at same time). If you can direct me, would mean a lot.

Sorry seems like, I uploaded a wrong script. But the one i attached here is the real one which match with the screenshot.
Thank you for your time
Truss Model -18a (47.5 KB)

Well you need to either use a multiobjective optimisation tool such as octopus or wallacei. Alternatively you can try to combine multiple values into one fitness value by adding them. You will need to assign a specific weight to this rather than just adding total mass and the min displacement as the values are significantly different.

A good resource would be Galapagos or Similar - #7 by DavidRutten