Problem with adding goals in the List[IGoal]() while running Kangaroo2 in python

I was trying to run the kangaroo with python script.
Although the code works in the end, I do not fully understand how the function works in kangaroo solver.
Sometimes I need to code the following line before I add the goal object into the Goal List.
ks.PhysicalSystem().AssignPIndex(Goal, Tol)
Without the line, the solver will show the Runtime error (AggregateException).
I am not sure why or how this happened. If anyone has hints or ideas maybe?
Thanks in advance.

doubts for K2.gh (15.5 KB)

Hi, just a suggesion.I noticed that when you called the step() method for PhysicalSystem object, multi-threading is set to True. You may be able to track exceptions better if you set it to False (instead of one overarching AggregateExecption).

I believe you need to invoke ks.PhysicalSystem().AssignPIndex(Goal, Tol) to add the GoalObject to the PhysicalSystem

1 Like