I have suffered a bit yesterday to get my program works when updating hierarchies. With the JAVA API as with the .NET API you must update arrays of Consolidations for the parent element. The initial array you get is wrapped by JYTHON in a pyarray structure which is not a list and cannot be extended using the .append list function. You must create a larger array (type: org.palo.api.Consolidation) with Jarray.zeros and copy the initial array's elements into the new array, adding next a new Consolidation at the end of the array. I wonder if there is not a simpler way of updating hierarchies, as with EXCEL or PHP APIs ?If this is the only way to do it, could not it be integrated in a method of the JAVA API ? Perhaps one can use the ElementNodes, but only the internal methods seem useful to do the trick ... (but I have not yet well understood that part of the API...)
i guess you are looking for a utility method that just adds a consolidation ...
Sorry, but that is not provided in jpalo right now ...
you could help yourself out with the following code ...
This utility method would provide the functionality to add a single consolidation.
Hope this helps,
Thanks; seems simpler than what I have done (perhaps faster too) ; I shall translate it into JYTHON.LJ
The possibility to add a Consolidation in a simple and optimized way would be indeed useful. All the more so since my program runs out of memory manipulating arrays when the dimensions grow larger !LJ
i believe even adding a few 10000 consolidations should be ok. I haven't tested such high-load consolidations. But chances are good that other parts of the system show performance problems before updateConsolidation() does.
I will get back to you on this issue. I am not yet convinced that the java API is a bottleneck here.
StepanStepan Rutz, Tensegrity-Software
Perhaps it is the JYTHON layer, but I think it is rather the fact that I am not a good java programmer that cleans up things when necessary :). A fool-proof part of the java API (something for the nulls) could be handy .LJ