Re: MLM Numbers Game
- Posted by "C. K. Lester" <cklester at yahoo.com> Oct 12, 2001
- 418 views
Doesn't seem to work for the 10557 case... In fact, the matrix is only filled with 10556. > D'oh! I thought I could simply get away by checking the lowest rank. This > should work: > > --**************CHANGE THIS**************-- > if quo then > sum = quo > actual[ix] += sum > pop -= sum > for i = ix-1 to 1 by -1 do > sum *= required[i+1] > pop -= sum > actual[i] += sum > end for > else > pop += 1 > actual[ix+1] -= 1 > end if > --************************************-- > > --pop = remainder( pop , amount[ix] ) > ix -= 1 > end while > > if ix > 1 then > actual[ix] -= > > end if > > > > Is it possible to manage the matrix itself in a sequence > > variable? This > > might allow us to actually PLACE units instead of estimate > > where they'd > > be... > > I don't think you'd want something like that. Seems too difficult to > manage. However, you might set up something like an EDS table or simlply > use a-lists (EDS would probably be better for large populations, but Jiri's > a-list code is pretty easy to use): > > The key could be a name or whatever. You'd also store the rank, 'parent' > and 'children'. I'll simply put the 'key' as the first sequence element: > > {key, Rank, Parent, {Children (immediate)} > {Gen1, 5, {}, {Capt1, Capt2, Capt3, Capt4, Capt5}} > {Capt1, 4, Gen1, {lt1, lt2,...}} > > Now, you can find/add/delete as you like, and you can also assemble a tree > of people rather easily. Of course, if you delete, you'll need to remember > to update parent/children according to the rules of the organization (ie, do > you inheirit the children of a deleted child?} > > Matt Lewis > >