Hello Developers,
this should be an interesting little allgorithm job.
I am looking for an algorithm that is combining multiple values in n dimensions based on the attached class modell and unit code.
The following classes of the model are important for the allgorithm:
- TUniverse: Contains Dimensions that have possible values and TWorld instances, the combination allgorithm that shall be developed is a member of TUniverse
- TWorld: A world contains specific values (TDimensionValue instances) of a dimension that are contained in a universe
- TDimension: Contains possible values
- TDimensionValue: A specific value in a dimension
The allgorithm shall be developed in the TUniverse member CreateWorldPermutations.
So what shall the Allgorithm do? Example:
Lets assume we have the following three dimensions D1, D2 and D3 ...
D1: Possible Values (D1E1, D1E2)
D2: Possible Values (D2E1, D2E2)
D3: Possible Values (D3E1, D3E2)
... the allgorithm shall fill a TObjectList with World instances that contain all possible combinations of the possible values in the dimensions ...
World1: D1E1, D2E1, D3E1
World2: D1E2, D2E1, D3E1
World3: D1E1, D2E2, D3E1
World4: D1E2, D2E2, D3E1
World5: D1E2, D2E1, D3E2
World6: D1E2, D2E2, D3E2
[...and so on ... if I should have missed any]
Attached you find the UML classdiagram and a zip with the code so far - the important unit (that which contains the classes) is the unit "[login to view URL]".
The projects are developed in XE5 - but as already mentioned the only really important unit is the one with the classes. The other projects are just testprojects around the class model.
What I need is the implementation of this allgorithm that is combining worlds with the possible values of the dimensions.
I guess this is an easy one for a developer that is good in recursion.