| ||||||||||
Turns out that the Homework description was correct already – it says turn in "Agent and Simulation SUBCLASSES". Turn in Agent and Simulation, too, if you change them, but you shouldn't need to. Mark Guzdial |
If you have deer.java, wolf.java, and corn.java, you're doing something wrong. Mark Guzdial |
It's up to you. It can look like Ken or a Bratz doll, if you want. Mark Guzdial |
Yep! Mark Guzdial |
Make the JPEGs? You mean the frames of the animation? Totally optional, but if you do an interesting run, feel free to send them to me and I'll make a movie of them for you. Mark Guzdial |
Your call! Either add an instance variable for gender, or subclass. (That's why it's extra credit.) Mark Guzdial |
No, use DeerAgent and WolfAgent and WDSimulation Mark Guzdial |
Corn grows, dies, and has baby corn every 12 weeks. Mark Guzdial |
I just went through Doroteya's and Jennifer's code, and it suggests somethings for everyone to watch for: |
I will be at Office Hours on Friday from 1-2, then I have to leave to pick up kids from school. I'll be available electronically up until the turnin. Mark Guzdial |
Most of these problems are because of the creating-from-one-list, running-from-another problem, I think. Mark Guzdial |
Follow the original WDSimulation and only create agents in setUp(). Mark Guzdial |
Yes – perfectly reasonable thing to do. I didn't check the numbers first, so it's not too surprising that I gave you an out of balance ecology to begin with. DON'T run my numbers – start out with more deer, or with a larger smell range for corn. But do run three sets of rules/numbers. Mark Guzdial |
Phew! Thanks! This is what mine was looking like @ timestep 75: |
You're right with the fix, Jim, but I'm sorry (and somewhat surprised!) that that bug is still there. I thought I'd tested that–but obviously, I didn't! I think it's a pretty interesting result that if the Deer can't find the corn, they all die off then the corn just goes bonkers growing everywhere (nothing to stem the tide). I agree with Jim – it's probably a timestep==0 issue. I'm not too worried about an off-by-one error like that. Keep plugging away! Mark Guzdial |
To get the world from the Agent, use this.getModelDisplay(). To get the simulation from the agent, use this.getSimulation(). Mark Guzdial |
To create your text file, you need to start out saying simulationInstance.openFile("C:/mytextfile.txt"); after you create your simulation instance. AFTER running, you need to say simulationInstance.closeFile(). And notice Jim's comment above – WDSimulation.java has "/t" where it should have "\t" in lineForFile(), and you'll need to fix that. Mark Guzdial |
Agreed – nothing is set in stone. REMOVEDge whatever you want. Your goal is a balanced ecology. Mark Guzdial |
If you want a question answered early enough to be useful, ask it early enough to be useful. I make a serious effort to respond here, but it's not my job to answer questions in the last hour or two that should have been asked much earlier. Mark Guzdial |