Re: Army Composition

new topic     » goto parent     » topic index » view thread      » older message » newer message

Derek,

C.K. can correct me if I'm wrong, but I think he intends to approach it
backwards from your assumption, namely  that there will *always* be grunts,
but only any generals if there are enough grunts to support them.  So in an
army of 4, there'd only be 4 grunts, period, I think?  Of course, it's also
possible he hadn't considered this possibility :)


He said:
<
I want to know how many a certain population can support.

If I have 2 million people, how many will be soldiers, how many Generals,
and how many of each rank in between... You have to build it from the bottom
up... Maybe there won't be any generals if the population isn't over a
certain number...>

Dan

----- Original Message -----
From: "Derek Parnell" <ddparnell at bigpond.com>
To: "EUforum" <EUforum at topica.com>
Sent: Wednesday, October 10, 2001 9:28 PM
Subject: RE: Army Composition


>
>
> C. K. Lester wrote:
> > For a given population, what is the maximum number of persons at each
> > rank?
> >
> > Soldiers - no requirements
> > Squad Leader - commands 20 soldiers
> > Lt. - commands 10 Squad Leaders
> > Captain - commands 10 Lt.s
> > General - commands 5 Captains
> >
> > I need a EUPHORIA program to compute these values given a population.
> >
> > Who's got one?
>
> Here is my humble attempt. But first a few assumptions need to be
> stated.
>
> There is a precedence involved, such that we must have at least one of
> each rank, except if there are not enough people to fill all stations.
> Using the ranks above, if there was only an army of 4, then we would
> have a General, a Captain, a Lt, and a Squad leader, but no grunts.
>
> So, each SL can handle 20 grunts plus him/herself thus a maximum of 21
> people are involved for each SL. A Lt can handle 10 SL plus him/herself,
> thus as there as 21 people for each SL it means that for a Lt there is a
> maximum of 10 * 21 + 1 = 211. And so on up the line. This means that a
> General can have as many as 10556 people under him/herself.
>
> So for every 10556 people (or fraction thereof) we need a General.
> Taking the Generals out of the remaining corp size, we can then see how
> many Captains are needed for the remaining people. Etc...
>
> Anyhow, here is a generalised program that does all these calcs...
>
> -------------
> sequence UnitHead,      -- Rank of unit leader
>          MaxUnitSize,   -- Maximum number of immediate subordinates
>          MaxGroupSize,  -- Maximum number of total subordinates
>          UnitSize       -- Number of people in each rank
>
> integer CorpSize        -- Total size of army corp
>
>
> UnitHead = {
>         "General",
>         "Captain",
>         "Lieutenant",
>         "Corporal",
>         "Soldier"
>         }
> MaxUnitSize = { 5, 10, 10, 20, 0 }
>
> CorpSize = 20000
>
> -- Returns the next integer if the parameter has a decimal portion.
> function ceiling(atom x)
>     integer q
>
>     q = floor(x)
>     return q + (x!=q)
> end function
>
> -- Calculates the total number of subordinates for each rank.
> procedure CalcGroupSize()
>     integer lStart
>
>     lStart = 0
>     MaxGroupSize = repeat(0, length(UnitHead))
>
>     for i = length(UnitHead) to 1 by -1 do
>         MaxGroupSize[i] = MaxUnitSize[i] * lStart + 1
>         lStart = MaxGroupSize[i]
>     end for
> end procedure
>
>
> -- Calculates the required number of people for each rank.
> procedure CalcUnitSize()
>     integer lRemaining
>
>     lRemaining = CorpSize
>     UnitSize = repeat(0, length(UnitHead))
>
>     for i = 1 to length(UnitHead) do
>         UnitSize[i] = ceiling(lRemaining / MaxGroupSize[i])
>         lRemaining -= UnitSize[i]
>     end for
>
> end procedure
>
> procedure DoCalcs()
>
>     CalcGroupSize()
>
>     CalcUnitSize()
>
> end procedure
>
>
<snip>

>
>

new topic     » goto parent     » topic index » view thread      » older message » newer message

Search



Quick Links

User menu

Not signed in.

Misc Menu