package uk.ac.leeds.sog.moses.agent; /** * @author Belinda *This class provides the constructor for single adults. *Methods only related to this type of people are also provided here. */ public class SingleAdult extends Person { private static final long serialVersionUID = 1L; private Person i_hrp = null; //constructor public SingleAdult(int id) { super(id); i_maritalStatus = 0; } //method to get the 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 the string with information of this person public String toString() { StringBuffer buff = new StringBuffer(); buff.append("type=Adult"); buff.append(" HRP_PID=" + i_hrp.getPid()); buff.append(" "); buff.append(super.toString()); return buff.toString(); } }