>
Simulation of Rabbit/Coyote Population Changes
    Using Simplified Lotka-Volterra Model

> import EcologyEquations
>   (displayRabbitCoyotePopulationTrajectory)

> import IOutilities(integralFromString, realFloatFromString,
>                    rightJustify, getCookedLine       )

> main =
>   do
>     putStr msgExplainIn
>     issuePrompt promptWidth
>     widthAsString <- getCookedLine
>     issuePrompt promptHeight
>     heightAsString <- getCookedLine
>     issuePrompt promptPeriod
>     periodAsString <- getCookedLine
>     issuePrompt prompt_i
>     iAsString <- getCookedLine
>     issuePrompt prompt_s
>     sAsString <- getCookedLine
>     issuePrompt prompt_e
>     eAsString <- getCookedLine
>     issuePrompt prompt_g
>     gAsString <- getCookedLine
>     issuePrompt prompt_r0
>     r0AsString <- getCookedLine
>     issuePrompt prompt_c0
>     c0AsString <- getCookedLine
>     putStr msgExplainOut
>     putStr "\n"
>     putStr(displayRabbitCoyotePopulationTrajectory
>              (integralFromString widthAsString)
>              (integralFromString heightAsString)
>              (integralFromString periodAsString)
>              [realFloatFromString iAsString,
>               realFloatFromString sAsString,
>               realFloatFromString eAsString,
>               realFloatFromString gAsString ]
>              [realFloatFromString r0AsString,
>               realFloatFromString c0AsString ]    )

> issuePrompt = putStr . rightJustify 65
> msgExplainIn = "Enter Rabbit/Coyote Simulation Parameters\n"
> promptWidth  = "Width of diplay (in characters across line): "
> promptHeight = "Height of diplay (in lines down page): "
> promptPeriod = "Length of simulation period (in months): "
> prompt_i     = "Rabbit birth rate " ++
>                  "(monthly fractional increase): "
> prompt_s     = "Coyote death rate " ++
>                   "(monthly fractional decrease if starving): "
> prompt_e     = "Probabilty of coyote/rabbit encounter " ++
>                   "(monthly, by individual): "
> prompt_g     = "Coyote birth rate " ++
>                   "(monthly increase from eating one rabbit): "
> prompt_r0    = "Rabbit population at start of cycle: "
> prompt_c0    = "Coyote population at start of cycle: "
> msgExplainOut= "Population Cycle with These Parameters:\n"

Last Modified: