Hi all. I'm trying to create a class in Processing based on some code I wrote in Python (for EdX MIT 6.00x - the best course I've ever taken online). I've pasted the code below. The error I'm running into involves getting Processing to return an instance of a class.
if (random(0,1) < (maxBirthProb * (1- popDensity))) {
newVirus = new SimpleVirus(maxBirthProb, clearProb);
return newVirus;
} else {
print("NoChildException");
}
}
}
Now clearly object isn't a viable variable and class can't be used either. Any ideas on how I can set this method up to generate a new instance of the SimpleVirus class and then return it. Thanks for any help. If my request isn't clear, please let me know and I will try to clarify.