package uk.ac.leeds.sog.moses.agent; import org.apache.log4j.Logger; /** * @author Belinda *This class provides the constructor for child dependents. *Methods only related to this type of people are also provided here. */ public class Child extends Person { private static final long serialVersionUID = 1L; // HRP protected Person i_hrp = null; // left house? Y(1), N(0) protected int i_leftHouse; private static Logger s_logger = Logger.getLogger(Child.class); //constructor of child dependents public Child(int id) { super(id); i_hrpStatus = 0; i_maritalStatus = 0; i_leftHouse = 0; } //method to get the child's 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; } //check if the child has reached 16 and left home public int getLeftHouse() { return i_leftHouse; } //set the value of whether the child left home public void setLeftHouse(int left) { i_leftHouse = left; } //method to get the String with information of the child public String toString() { StringBuffer buff = new StringBuffer(); buff.append("type=Child"); buff.append(" HRP_PID=" + i_hrp.getPid()); buff.append(" Left_House=" + i_leftHouse); buff.append(" "); buff.append(super.toString()); return buff.toString(); } }