package uk.ac.leeds.sog.moses.agent; import org.apache.log4j.Logger; /** * @author Belinda *This class provides the constructor for elderly dependents. *Methods only related to this type of people are also provided here. */ public class ElderlyDependent extends Person { private static final long serialVersionUID = 1L; private Person i_hrp = null; private static Logger s_logger = Logger.getLogger(ElderlyDependent.class); //constructor public ElderlyDependent(int id) { super(id); i_hrpStatus = 0; } //method to get HRP public Person getHrp() { return i_hrp; } //method to set the HRP public void setHrp(Person a_hrp) { i_hrp = a_hrp; } //age one more year public void step() { i_age += 1; } //method to get a string with the information of the elderly public String toString() { StringBuffer buff = new StringBuffer(); buff.append("type=ElderlyDepedent"); buff.append(" HRP_PID=" + i_hrp.getPid()); buff.append(" "); buff.append(super.toString()); return buff.toString(); } }