The logic between FDN-N's is the easy bit. Simple terms there is ultimately one factory array for the sector, each factory is called and the Primary & Secondary resources are checked. If the FDN-N has the ware and in quantity it's passed to the factory , this is were I'll put in the script to capture what wares are not held by the Node.
The FDN-N search function will build a quick array of FDN's and the number of Jumps away. Loop through the FDN-N's and search for the right ware, if available transfer. Repeat for each FDN-N.
There will have to be checks to ensure that any FDN-N is still left with the right amount of wares to supply it's sector. I may add the ability to lock wares from inter-sector operations just like factories can be locked.
I have the makings of the check written down. The distribution flow can be captured and saved it in an array locally on the FDN-N (Factory, Ware, Amount, then a counter to say which rotation the transfer happened, or even game time for easy sort). I'll be using this to created flow reports keeping the last hours worth, so 20 rotations to cover an hour.
With the above details I'll be able to check predicted usage of wares and the FDN-N will only move what wares it classes as free.
This is all in the planning stage at the moment but will need to be done prior to any inter sector operations or you could end up with wares in a FDN-N loop!
One option I'm looking at is that the FDN-N will have a sphere of influence depending on it's size.
XL - 15 sectors
L - 11 sectors
M - 8 sectors
S - 5 sectors
If the sector is within range, has an FDN-Relay (think upgraded Advanced Satellite) and the fall within it's or an Advance Satellite coverage it will be managed by the FDN-N.
If I go with this option which at the moment I'm liking the sound of (changes every time I come up with a new option), I'll not include FDN-N to FDN-N operations. It will a) make FDN far more powerful than I intended, and b) far more work than I'd like
I'll just add the ability to the FDN-N menu to add a sector, first check, is it within the jump limit, second check is there an FDN-Relay, third check is it managed by another FDN-N.
This would be an extension of existing checks, just looped to cover multi sectors.
I will still include the flow reports as I thing this will be a good idea even without inter FDN-N operations.
As always this is open to discussion and ideas
LA