All pastes #110780 Raw Edit

Something

public text v1 · immutable
·published 2006-08-01 22:17 UTC
rendered paste body
Population:

import java.util.*;

public class Population {

	protected double Timestep = 1;
	protected double DiscountRate = 0.03;
	protected int InitialSize;
		
	/* The Simulated Population */
	
	ArrayList<Person> population = new ArrayList<Person>();
	
	/* Main Method */
	
	public static void main(String[] args) {
		new Population().Initialize(10);
	}
	
	/* Initialize the Population */
		
	public void Initialize(int InitialSize) {
		this.InitialSize = InitialSize;
		for (int x = 0 ; x < InitialSize; x++) {
			population.add(new Person(58, 68, 0, 0, 0, 0));
		}
		new Status().Aging();
	}
	
	/* Get/Set */
	
	public double getTimestep() {
		return Timestep;
	}
	
	public double getDiscountRate() {
		return DiscountRate;
	}
	
}


Person:

public class Person {
	
	private double Age;
	private double MaxAge;
	private double Costs;
	private double Qaly;
	private double Ly;
	private int State;

	public Person(double Age, double MaxAge, double Costs, double Qaly, double Ly, int State) {
		this.Age = Age;
		this.MaxAge = MaxAge;
		this.Costs = Costs;
		this.Qaly = Qaly;
		this.Ly = Ly;
		this.State = State;
	}
	
	public double getAge() {
		return Age;
	}
	
	public double getMaxAge() {
		return MaxAge;
	}
	
	public double getCosts() {
		return Costs;
	}
	
	public double getQaly() {
		return Qaly;
	}
	
	public double getLy() {
		return Ly;
	}
	
	public double getState() {
		return State;
	}
	
	public void setCosts(double Costs) {
		this.Costs = Costs;
	}
	
	public void setAge(double Age) {
		this.Age = Age;
	}
	
	public void setQaly(double Qaly) {
		this.Qaly = Qaly;
	}
	
	public void setly(double Ly) {
		this.Ly = Ly;
	}
	
	public void setState(int State) {
		this.State = State;
	}
	
}

Status:


public class Status {
	
	public void Aging() {
		for (Person it : new Population().population) {
			System.out.println(it.getAge());
		}
	}

}