Hello,
i dont know if its even possible, but here is my problem.
My goal is find the best shape for my IRL construction and i would like to use genetic algorithm (yeah… high hopes) and for that so i want to make a random construction, that i would coppy around and eventualy end up with the best one.
For that i wanted to make a class Construction and there i would do all the calculations and all.
My problem is, that my construction is made from rods (lines) and joints (points), each with specific parameters so i made a class for rods and joints.
I have already made a script for one construction, but when i tried to copy them it gave me an error so i tried to do it step by step and eventualy i found out, that if im trying to do something in rods class with joints class informations, it says, that the joint class cant be found.
Here is the code: https://pastebin.com/PuP7KK8y
The error says:
“NullPointerException
Could not run the sketch (Target VM failed to initialize).
For more information, read revisions.txt and Help ? Troubleshooting.”
and point to:
if (xa == most.joint_array.get(i).x & za == most.joint_array.get(i).z & xb == most.joint_array.get(j).x & zb == most.joint_array.get(j).z) {
On one hand i think it should be possible, but on other hand its not “global variable?” so if im working in “prut”(those are rods) class processing cant see outside of it.
I already though about some dirty solution with 3 global (i hope its called global) arrays with one being joints, other rods and the 3rd being the construction itself.
I have shortened the script and tweaked it a bit so its not in my native language and hopefuly easier to read. Each line represent new tab.
Thanks everyone who at less read it