project4 wrote: ↑Mon Jul 16, 2018 7:51 pm
I started to sniff around the code already and will do some experiments to understand it better.
For now I have a file with 5 parts and few constraints and from the measurements I've added it already takes about 100mSec to resolve (900 steps), so I have something to work with.
I can supply some test assemblies, done with A2plus. So you would have more test material. What do you like PM ? Zip here ?
project4 wrote: ↑Mon Jul 16, 2018 7:51 pm
Still need help with that question:
Is there an efficient method to reload the WB python scripts besides closing and reopening the whole FreeCAD?
Looks like switching to another WB and back to A2B didn't help
Restarting the whole application is pretty annoying...
It should be possible to convert the solversystem.py to an executable script, which you can start from FreeCAD. This uses always the new script.
You would have to add a section "if _name__ == __main__:" and some things within there. I can help if necessary.
project4 wrote: ↑Mon Jul 16, 2018 7:51 pm
Another question:
I see you didn't take the cache logic to your repository. Could you at least explain the logic behind it?
It sounds pretty logical to store some recalculated information and use it if parts of the assembly wasn't moved.
I do not quite understand your question. I think, my solving algorithm does not need a cache. Everything what is calculated is stored
within data structures in solversystem.py. If after calculation it turns out that parts are not been moved, the original placement is not updated.
So what do you mean exactly with "cache" ?
project4 wrote: ↑Mon Jul 16, 2018 7:51 pm
And another question:
Are all the calculations should be done sequentially? Can we parallelize them to utilize all the cores of the CPU?
From my experience that speeds up the things ALOT.
Without thinking about it too much, looks like different branches of the chain could be calculated separately from each other...
Could be possible. As function "calcMoveData()" is executed on constant data within this point, it can be perhaps be parallized.
Same for function "moveRigids()". Data calculated before is applied to all rigids. Think code could be parallized.
Edit 1:
if you have 4 CPU's, code will speed up max factor 4, probably less. I think Turro's idea implementing critical code with c++ or some other low level language will speed it up factor 100. So it is perhaps the better way.
/Edit 1:
And for your question in your next post:
I updated the branch "solverlogic" with Turro's code. I only changed code style a little bit.
Master branch will solve all testcases, but slow.
Turro's branch "solverlogic" is much faster but failes e.g. for my movable platform example.