17 SimplePerson(
const int i = 0) : id(i) {};
19 virtual void handleMessage(
const cMessage* msg);
28 void SimplePerson::init() {
31 scheduleAt(R::rweibull(3.0,90.0),
toCancer);
37 void SimplePerson::handleMessage(
const cMessage* msg) {
45 Sim::stop_simulation();
50 if (R::runif(0.0,1.0) < 0.5)
55 REprintf(
"No valid kind of event\n");
65 Rcpp::List parmsl(parms);
66 int n = Rcpp::as<int>(parmsl[
"n"]);
70 for (
double age=0.0; age<=100.0; age++) {
73 ages.push_back(1.0e+6);
76 for (
int i = 0; i < n; i++) {
77 person = SimplePerson(i);
78 Sim::create_process(&person);
79 Sim::run_simulation();