/* * file name: AntiSocialAgent.java * author: YOUR NAME HERE * date: * purpose: An Agent that keeps moving until it is alone. * * CS231 Project 3 - Agent-Based Simulation */ import java.awt.Color; import java.awt.Graphics; public class AntiSocialAgent extends Agent { // Do NOT declare x, y, radius or moved here. AntiSocialAgent inherits them. // ====================================================================== // TASK 3 - Constructor and draw() // ====================================================================== /** * Creates an AntiSocialAgent. */ public AntiSocialAgent(double x0, double y0, int radius) { // TODO (Task 3): call the parent constructor. (Look at SocialAgent.) // It must be the FIRST statement in this constructor. super(0, 0, 0); // placeholder so the file compiles - replace these arguments } /** * Draws a small circle at the Agent's position: * dark red (255, 0, 0) if it did not move during its last update, * light red (255, 125, 125) if it did. */ public void draw(Graphics g) { // TODO (Task 3) } // ====================================================================== // TASK 6 - updateState() // ====================================================================== /** * An AntiSocialAgent wants to be alone. * * Ask the Landscape for the agents within this agent's radius of its own * position. That list INCLUDES this agent itself. * * more than 1 agent in the list (anyone besides itself) -> moveRandomly, moved = true * otherwise -> stay put, moved = false */ public void updateState(Landscape scape) { // TODO (Task 6) } }