Info

32 public Properties getProperty() {

33 return props;

35 public IWeather getWeather() {

36 return weather;

38 public ISoil getSoilO {

39 return soil;

41 public IPlant getPlant() {

42 return plant;

44 public void simulate(Properties props) {

45 // Initializations

46 weather.initialize(props);

47 soil.initialize(props);

48 plant.initialize(props);

49 while (weather.hasNext()) {

50 weather.next();

51 soil.calculateRate();

52 if (plant.isPostPlanting())

5 3 plant. calculateRate();

54 soil.integrate();

55 if (plant.isPostPlanting()) 5 6 plant. integrate();

57 if (plant.isMatureQ) {

58 // Stop simulation

5 9 plant. setMaturityDay () ;

60 saveFinalResults();

61 return;

65 private void saveFinalResults() {

66 props = new Properties();

67 props.put("totalPlantDry Weight",

68 new Double(plant.getTotalPlantDryWeight()));

69 props.put("rootDry Weight", new Double(plant.getRootDryWeight()));

70 props.put("fruitDryWeight", new Double(plant.getFruitDryWeight()));

0 0

Post a comment