Finishing up
The final part of Project 2 just connects the simulation and model
pieces into a couple of functions.
The first of these functions is a wrapper for the simulate
function from
the grid.rkt
module.
(: run-model : Model-Params Natural Natural Natural -> (Grid Cell))
This function takes the model parameters, the number of rows and
columns in the grid, and the time limit. It generates an initial
grid according to the model parameters and then runs the simulation using
the model from model.rkt
and returns the final grid.
The second function is similar, but also takes the cell radius and the
tick rate as parameters. It runs the animated simulation using the
model and render information from model.rkt
.
(: animate-model :
Model-Params Natural Natural Natural Integer Positive-Real
-> (Grid Cell))
Because these functions involve randomness, we cannot use check-expect tests (except for degenerate model parameters). You can use your Simple Model implementation from Project 1 to test the new grid implementation.