[Xulu-commits] r126 - trunk/src/edu/bonn/xulu/plugin/model/sleuth

scm-commit at wald.intevation.org scm-commit at wald.intevation.org
Fri Apr 26 17:42:11 CEST 2013


Author: rgoetzke
Date: 2013-04-26 17:42:11 +0200 (Fri, 26 Apr 2013)
New Revision: 126

Modified:
   trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModel.java
   trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibration.java
   trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationContentManager.java
   trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationSelfModification.java
   trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationSelfModificationContentManager.java
Log:


Modified: trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModel.java
===================================================================
--- trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModel.java	2012-05-24 09:02:42 UTC (rev 125)
+++ trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModel.java	2013-04-26 15:42:11 UTC (rev 126)
@@ -2,14 +2,15 @@
 
 import java.util.HashMap;
 
-import de.schmitzm.data.property.PropertyReadAccess;
-import de.schmitzm.data.property.PropertyWriteAccess;
-import de.schmitzm.data.property.ScalarProperty;
-import de.schmitzm.geotools.data.WritableGrid;
 import edu.bonn.xulu.model.AbstractStepModel;
 import edu.bonn.xulu.model.XuluModel;
 import edu.bonn.xulu.plugin.data.grid.MultiGrid;
 
+import de.schmitzm.geotools.data.WritableGrid;
+import de.schmitzm.data.property.PropertyReadAccess;
+import de.schmitzm.data.property.PropertyWriteAccess;
+import de.schmitzm.data.property.ScalarProperty;
+
 /**
  *  <b>Urban Growth Model</b><br>
  *  This Model simulates urban growth. It is based on the algorithm of the SLEUTH-Model, which has originally been written in C code and could
@@ -526,8 +527,8 @@
 		} while (p < disp_value);	//while instead of for-loop, because it can only be checked in the end
 									//if all cells could be distributed, which is not known at the beginning of the loop.
 									//a part of the cells falls in excluded areas, etc.
-		statusOut.println("Dispersion-Treffer: "+anzDispTreffer);
-		statusOut.println("Breed-Treffer: "+anzBreedTreffer);
+		//statusOut.println("Dispersion-Treffer: "+anzDispTreffer);
+		//statusOut.println("Breed-Treffer: "+anzBreedTreffer);
 		return tmpGridDispBreed;	//returns a temporary Array containing the newly urbanized cells by the dispersion and breed growth rules
 	}
 	
@@ -664,7 +665,7 @@
 		int anzRoadTreffer = 0;
 		int[] cellValue = null;	//array of cell values
 		int RSearchRoad = 0;	//Random Road Search Index
-		int r = 1;	//number between 1 and the disp-Value, whih is increased during the follwing while-loop. It determines how many pixels are selected randomly for a possible road trip
+		int r = 1;	//number between 1 and the disp-Value, which is increased during the following while-loop. It determines how many pixels are selected randomly for a possible road trip
 		int anzTempRoadNb = 0;
 		
 		do{
@@ -732,13 +733,13 @@
 										for (int nbRoadCellsY = Y - roadNeighborhoodRange; nbRoadCellsY <= Y + roadNeighborhoodRange; nbRoadCellsY++){	//again increase the neighborhood in every loop
 						        			//statusOut.println("TEST-ROAD: "+nbRoadCellsX+","+nbRoadCellsY);
 											if ( nbRoadCellsX < areaMinX || nbRoadCellsY < areaMinY || nbRoadCellsX > areaMaxX || nbRoadCellsY > areaMaxY ||
-													Float.isNaN(outputGrid.getRasterSampleAsFloat(nbRoadCellsX,nbRoadCellsY)) ) //wenn Nachbarzelle au�erhalb des Rasters (NaN) --> ignorieren
+													Float.isNaN(outputGrid.getRasterSampleAsFloat(nbRoadCellsX,nbRoadCellsY)) ) //wenn Nachbarzelle außerhalb des Rasters (NaN) --> ignorieren
 												continue;	//if a cell is outside the raster (NaN), break and continue loop from the beginning
 											float roadValueNbTemp = roadGrid.getRasterSampleAsFloat(nbRoadCellsX,nbRoadCellsY);	//take the road value from that pixel
 											if (roadValueNbTemp > 0f){	//if the value is greater than 0 and thus is a road... 
 												anzTempRoadNb++;	//increase the number of temporary road neighbors
 												tempNbRoadCell = new int[] {nbRoadCellsX,nbRoadCellsY,anzTempRoadNb};	//build an array of neighboring road cells with its coordinates
-											//	statusOut.println("in Array: "+tempNbRoadCell[2]+"Random: "+RSearchNbRoad+"Anzahl tempor�rer Zellen: "+anzTempRoadNb);
+											//	statusOut.println("in Array: "+tempNbRoadCell[2]+"Random: "+RSearchNbRoad+"Anzahl temporärer Zellen: "+anzTempRoadNb);
 												if (tempNbRoadCell[2]==RSearchNbRoad){	//check the position in that array with the random number
 													tempRoadCell = tempNbRoadCell;	//the main temporary road cell is moved to this position
 													//statusOut.println("Strasse in Entfernung "+roadSearch+": "+tempRoadCell[0]+","+tempRoadCell[1]+","+tempRoadCell[2]);
@@ -772,7 +773,7 @@
 			}
 			
 		} while (r <= breed);
-		statusOut.println("Road-Treffer: "+anzRoadTreffer);
+		//statusOut.println("Road-Treffer: "+anzRoadTreffer);
 		return tmpGridRoad;
 	}
 	
@@ -945,6 +946,6 @@
 				outputGrid.setRasterSample( tmpGrid[x][y] ? 1f : 0f ,X ,Y);	//write the result to the output grid
 			}
 		}
-		statusOut.println("Temporary Urban Cells: "+t);
+	//	statusOut.println("Temporary Urban Cells: "+t);
 	}
 }

Modified: trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibration.java
===================================================================
--- trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibration.java	2012-05-24 09:02:42 UTC (rev 125)
+++ trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibration.java	2013-04-26 15:42:11 UTC (rev 126)
@@ -1,13 +1,13 @@
 package edu.bonn.xulu.plugin.model.sleuth;
 
+import edu.bonn.xulu.model.XuluModel;
+import edu.bonn.xulu.plugin.data.grid.MultiGrid;
+import de.schmitzm.geotools.data.WritableGrid;
 import de.schmitzm.data.property.ListProperty;
 import de.schmitzm.data.property.ListPropertyWriteAccess;
 import de.schmitzm.data.property.PropertyReadAccess;
 import de.schmitzm.data.property.PropertyWriteAccess;
 import de.schmitzm.data.property.ScalarProperty;
-import de.schmitzm.geotools.data.WritableGrid;
-import edu.bonn.xulu.model.XuluModel;
-import edu.bonn.xulu.plugin.data.grid.MultiGrid;
 
 /**
  * <b>Calibration of the Urban Growth Model</b><br>
@@ -48,7 +48,7 @@
  * @see UrbanGrowthModel
  * @see UrbanGrowthModel_MC
  * @author <a href="mailto:goetzke at uni-bonn.de">Roland Goetzke</a>
- * @version 1.1
+ * @version 1.2
  */
 public class UrbanGrowthModelCalibration extends UrbanGrowthModel {
 
@@ -72,7 +72,7 @@
 	protected PropertyReadAccess RA_slopeEnd = null;	//Slope-Coefficient
 	protected PropertyReadAccess RA_criticalSlope = null;	//Critical Slope Value
 	protected PropertyReadAccess RA_MonteCarlo = null;	//Number of MonteCarlo Iterations
-	protected ListPropertyWriteAccess WA_outResults = null;	//Output Validation Results
+	//protected ListPropertyWriteAccess WA_outResults = null;	//Output Validation Results
 	protected PropertyWriteAccess WA_SumOutStep = null;	// Step Results
 	
 
@@ -96,7 +96,7 @@
 	protected double criticalSlope = 0;	//Critical Slope Value
 	protected int MonteCarlo = 0;	//Number of Monte Carlo Iterations
 	protected ListPropertyWriteAccess outResults = null;	//Output Validation Results
-	protected MultiGrid SumOutStep = null;	//Step Results
+	//protected MultiGrid SumOutStep = null;	//Step Results
 		
 	protected int years = 0;
 	protected int neighborhoodRange = 0;
@@ -226,10 +226,10 @@
 		if (contManager.getResource(23).getData() != null)
 			RA_MonteCarlo = ((ScalarProperty) contManager.getResource(23).getData())
 					.getReadAccess(this);
-		WA_outResults = null;
+		/*WA_outResults = null;
 		if (contManager.getResource(24).getData() != null)
 			WA_outResults = ((ListProperty) contManager.getResource(24)
-					.getData()).getWriteAccess(this);
+					.getData()).getWriteAccess(this);*/
 		
 		
 		// Assign variables to work with
@@ -257,9 +257,9 @@
 	    slopeEnd		= RA_slopeEnd.getValueAsDouble();
 	    criticalSlope = RA_criticalSlope.getValueAsDouble();
 	    MonteCarlo 		= RA_MonteCarlo.getValueAsInt();
-		outResults 		= WA_outResults;
-		outStep 		= (MultiGrid)contManager.getResource(25).getData();
-		SumOutStep		= (MultiGrid)contManager.getResource(26).getData();
+		//outResults 		= WA_outResults;
+		outStep 		= (MultiGrid)contManager.getResource(24).getData();
+		//SumOutStep		= (MultiGrid)contManager.getResource(25).getData();
 		stepCount 		= 1;
 		years 			= steps.getValueAsInt();
 
@@ -300,7 +300,7 @@
 		releaseAccess(RA_slopeStep);
 		releaseAccess(RA_slopeEnd);
 		releaseAccess(RA_MonteCarlo);
-		releaseAccess(WA_outResults);
+		//releaseAccess(WA_outResults);
 		releaseAccess(WA_SumOutStep);
 	}
 
@@ -339,7 +339,7 @@
 			int slopeMax = 0;
 			slopeMax = getSlopeMax();
 			
-			statusOut.println("Max. Slope: "+slopeMax+" %");
+			//statusOut.println("Max. Slope: "+slopeMax+" %");
 					
 			//assigns for every slope value between 0 and the maximum slope that is below the critical slope the value calculated for the variable "lookup".
 			//all values higher than the critical slope become 1
@@ -366,20 +366,20 @@
 							max_RG_value = 100.0;			//Maximum possible road gravity value
 							double disp_value = Math.round((disp*0.005)* Math.sqrt(Math.pow(inputGrid.getWidth(), 2)+(Math.pow(inputGrid.getHeight(), 2))));
 							double rg_value = Math.round((roadGravity/max_RG_value)*((areaWidth + areaHeight)/16));
-							statusOut.println("RG"+roadGravity+" / MaxRG:"+max_RG_value+" * (Width"+areaWidth+" + areaHeight"+areaHeight+") / 16");
+							//statusOut.println("RG"+roadGravity+" / MaxRG:"+max_RG_value+" * (Width"+areaWidth+" + areaHeight"+areaHeight+") / 16");
 							
 							max_search_index = Math.round(4*((int)rg_value*(1+(int)rg_value)));	//area in which to look for a road cell
-							statusOut.println("MaxSearchIndex: "+max_search_index);
+							//statusOut.println("MaxSearchIndex: "+max_search_index);
 														
 							for(int MC = 1; MC <= MonteCarlo; MC++){	//perform the model algoith 1-MC times
-								statusOut.println("Performing "+MonteCarlo+" Monte Carlo Iterations (years: "+stepNo);
+								//statusOut.println("Performing "+MonteCarlo+" Monte Carlo Iterations (years: "+stepNo);
 								totalSteps++;
 								/**
 								 * The model run is being performed for every time step. For the final evaluation 
 								 * only the image of the final step is needed.
 								 */
 								for(int timeSteps = 1;timeSteps <=years;timeSteps++){	
-									statusOut.println("Year "+timeSteps);
+									//statusOut.println("Year "+timeSteps);
 									boolean[][] tmpGrid = new boolean[inputGrid.getWidth()][inputGrid.getHeight()];	//a temporary raster
 									
 									/*****************************************************************
@@ -476,14 +476,14 @@
 										WritableGrid simulationMap = outStep.getGrid(MC-1);		//write the final step result to the grid list
 										float[] mrv = MultipleResolutionComparison(simulationMap);	//perform the MRV
 										for(int i = 0;i < mrv.length;i++){
-											statusOut.println(mrv[i]);
+										//	statusOut.println(mrv[i]);
 											mrvTempResultArray[i] += mrv[i];
 										}
 									}
 								}	//END OF THE TIME STEPS
 								
 								if (MC == MonteCarlo){
-									SumOutStep.addGrid();	//add a final raster to the GridList (contains the sum of all iterations)
+									//SumOutStep.addGrid();	//add a final raster to the GridList (contains the sum of all iterations)
 									
 									//statusOut.println("Step Grids: "+outStep.getGridCount());
 									
@@ -494,13 +494,13 @@
 												float tempUrb = (Float) outStep.getGrid(gridNo).getRasterSample(x,y);	//take the pixel value
 												sumUrb  += tempUrb;		//and add its value
 											}
-											SumOutStep.getGrid(runs-1).setRasterSample(sumUrb,x,y);	//put the layer in the raster list containing the step results
+											//SumOutStep.getGrid(runs-1).setRasterSample(sumUrb,x,y);	//put the layer in the raster list containing the step results
 										}
 									}
 									
-									System.out.print("Slope: "+slope+" Spread: "+spread+" Disp: "+disp+" Breed: "+breed+" Road: "+roadGravity+" : ");
+									System.out.print("Slope: "+slope+" Spread: "+spread+" Disp: "+disp+" Breed: "+breed+" Road: "+roadGravity+" ");
 									
-									for(int i = 1;i <= mrvTempResultArray.length-2;i++){
+									for(int i = 0;i <= mrvTempResultArray.length-1;i++){
 										//print every element of the result array comma separated in one line in the status output
 										finalArray[i] = mrvTempResultArray[i]/MonteCarlo;
 										System.out.print(finalArray[i]+",");
@@ -522,10 +522,25 @@
 							}	System.out.println("");
 							
 							//END OF THE MONTE CARLO ITERATIONS
+							if (roadGravity == 1 && roadGravityStep != 1){		//Coefficients set to 0 if starting with 1. If step is 1, it is not set to 0, because endless loop otherwise.
+								roadGravity = 0;
+							}
 						}	//END OF ROADGRAVITY COMBINATION
+						if (breed == 1 && breedStep != 1){
+							breed = 0;
+						}
 					}	//END OF BREED COMBINATION
+					if (disp == 1 && dispStep != 1){
+						disp = 0;
+					}
 				}	//END OF DISP COMBINATION
+				if (spread == 1 && spreadStep != 1){
+					spread = 0;
+				}
 			}	//END OF SPREAD COMBINATION
+			if (slope == 1 && slopeStep != 1){
+				slope = 0;
+			}
 		}	//END OF SLOPE COMBINATION
 		System.out.println("Finished "  + " in " + ((System.currentTimeMillis() - localStartTime)) + " ms\n");
 	}	//END OF MODEL STEP
@@ -588,7 +603,7 @@
 						if ((int) Stmp == i)
 							Sj++;	//if cell belongs to category i, count it (for Simulation map)
 				}
-			statusOut.println("Class "+i+": Reference("+Rj+"), Simulation("+Sj+")");
+			//statusOut.println("Class "+i+": Reference("+Rj+"), Simulation("+Sj+")");
 		}
 		
 		int ngrids = 0;		//number of resolution grids
@@ -649,9 +664,9 @@
 			//statusOut.println(SumWn+" / "+SumCells);
 			totalAgreement = SumWn / (float)SumCells;	//Main Results
 			//statusOut.println(totalAgreement);	
-			outResults.addValue(totalAgreement);
-			resultArray[0][ngrids] = r;
-			resultArray[1][ngrids] = totalAgreement;	//write the results in an array 
+			//outResults.addValue(totalAgreement);
+			resultArray[0][ngrids-1] = r;
+			resultArray[1][ngrids-1] = totalAgreement;	//write the results in an array 
 			//the result array looks like this:
 			//1	   |2	 |4	   |8    |...
 			//0.876|0.892|0.913|0.948|...
@@ -669,10 +684,10 @@
 		float Ft = 0f;
 		
 		for(int i = 0; i < ngrids; i++){
-			System.out.print(resultArray[1][i+1]+",");
+			//System.out.print(resultArray[1][i]+",");
 			//calculations for weighted average after Costanza (1989):
-			w = (float) Math.exp(-0.1*(resultArray[0][i+1] - 1));
-			Fw = resultArray[1][i+1]*w;
+			w = (float) Math.exp(-0.1*(resultArray[0][i] - 1));
+			Fw = resultArray[1][i]*w;
 			SumW += w;
 			SumFw += Fw;
 			//statusOut.println(i+": w:"+w+" Fw: "+Fw+" SumW: "+SumW+" SumFw: "+SumFw);

Modified: trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationContentManager.java
===================================================================
--- trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationContentManager.java	2012-05-24 09:02:42 UTC (rev 125)
+++ trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationContentManager.java	2013-04-26 15:42:11 UTC (rev 126)
@@ -13,7 +13,7 @@
 public class UrbanGrowthModelCalibrationContentManager extends UrbanGrowthModelContentManager {
 	
 	public UrbanGrowthModelCalibrationContentManager(int additionalRes) {
-		super(14+additionalRes);	//14, because in the parent class are 12 resources (+14 = 26)
+		super(12+additionalRes);	//14, because in the parent class are 12 resources (+14 = 26)
 	    
 	    resource[6] = new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Reference Grid",ScalarProperty.class,WritableGrid.class,false);
 	    resource[7] = new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Spread Coefficient Start",ScalarProperty.class,Double.class,false);
@@ -33,9 +33,9 @@
 	    resource[21]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Slope Coefficient End",ScalarProperty.class,Double.class,false);
 	    resource[22]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Critical Slope",ScalarProperty.class,Double.class,false);
 	    resource[23]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Number of MonteCarlo Iterations",ScalarProperty.class,Integer.class,false);
-	    resource[24]= new ValuePropertyResource(ModelResource.CATEGORY_OUTPUT,"Validation Results",ListProperty.class,Float.class,false);
-	    resource[25]= new DefaultModelResource(ModelResource.CATEGORY_OUTPUT,"Step Results",MultiGrid.class,false);
-	    resource[26]= new DefaultModelResource(ModelResource.CATEGORY_OUTPUT,"Sum Step Results",MultiGrid.class,false);
+	   // resource[24]= new ValuePropertyResource(ModelResource.CATEGORY_OUTPUT,"Validation Results",ListProperty.class,Float.class,false);
+	    resource[24]= new DefaultModelResource(ModelResource.CATEGORY_OUTPUT,"Step Results",MultiGrid.class,false);
+	    //resource[25]= new DefaultModelResource(ModelResource.CATEGORY_OUTPUT,"Sum Step Results",MultiGrid.class,false);
 	 	// ===== Ressourcen Bezeichnungen lokalisieren =====
 	    resetCaptions(null);
 	}

Modified: trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationSelfModification.java
===================================================================
--- trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationSelfModification.java	2012-05-24 09:02:42 UTC (rev 125)
+++ trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationSelfModification.java	2013-04-26 15:42:11 UTC (rev 126)
@@ -28,7 +28,7 @@
  * @see UrbanGrowthModel
  * @see UrbanGrowthModel_MC
  * @author <a href="mailto:goetzke at uni-bonn.de">Roland Goetzke</a>
- * @version 1.1
+ * @version 1.2
  */
 public class UrbanGrowthModelCalibrationSelfModification extends UrbanGrowthModelCalibration {
 
@@ -78,28 +78,28 @@
 		this.contManager = (UrbanGrowthModelCalibrationSelfModificationContentManager) super.contManager;
 	
 		RA_roadGravSens = null;
-		if (contManager.getResource(27).getData() != null)
-			RA_roadGravSens = ((ScalarProperty) contManager.getResource(27).getData())
+		if (contManager.getResource(25).getData() != null)
+			RA_roadGravSens = ((ScalarProperty) contManager.getResource(25).getData())
 					.getReadAccess(this);
 		RA_slopeSens = null;
-		if (contManager.getResource(28).getData() != null)
-			RA_slopeSens = ((ScalarProperty) contManager.getResource(28).getData())
+		if (contManager.getResource(26).getData() != null)
+			RA_slopeSens = ((ScalarProperty) contManager.getResource(26).getData())
 					.getReadAccess(this);
 		RA_criticalLow = null;
-		if (contManager.getResource(29).getData() != null)
-			RA_criticalLow = ((ScalarProperty) contManager.getResource(29).getData())
+		if (contManager.getResource(27).getData() != null)
+			RA_criticalLow = ((ScalarProperty) contManager.getResource(27).getData())
 					.getReadAccess(this);
 		RA_criticalHigh = null;
-		if (contManager.getResource(30).getData() != null)
-			RA_criticalHigh = ((ScalarProperty) contManager.getResource(30).getData())
+		if (contManager.getResource(28).getData() != null)
+			RA_criticalHigh = ((ScalarProperty) contManager.getResource(28).getData())
 					.getReadAccess(this);
 		RA_Boom = null;
-		if (contManager.getResource(31).getData() != null)
-			RA_Boom = ((ScalarProperty) contManager.getResource(31).getData())
+		if (contManager.getResource(29).getData() != null)
+			RA_Boom = ((ScalarProperty) contManager.getResource(29).getData())
 					.getReadAccess(this);
 		RA_Bust = null;
-		if (contManager.getResource(32).getData() != null)
-			RA_Bust = ((ScalarProperty) contManager.getResource(32).getData())
+		if (contManager.getResource(30).getData() != null)
+			RA_Bust = ((ScalarProperty) contManager.getResource(30).getData())
 					.getReadAccess(this);
 		
 		// Assign variables to work with
@@ -270,7 +270,7 @@
 										boolean[][] tmpGridRoad = new boolean[inputGrid.getWidth()][inputGrid.getHeight()];	//a temporary raster
 										statusOut.println("Start Road Growth...");
 										tmpGridRoad = RoadGrowth(tmpGrid,rg_value,breed,disp);	//calls the method "RoadGrowth" to perform the Road weighted growth
-										statusOut.println("Road things returned...");
+										//statusOut.println("Road things returned...");
 										int anzRoad = 0;	//number of cells urbanized by Road Growth
 										for (int x = 0; x < inputGrid.getWidth();x++)
 											for(int y = 0; y < inputGrid.getHeight();y++){
@@ -381,14 +381,14 @@
 											WritableGrid simulationMap = outStep.getGrid(MC-1);		//write the final step result to the grid list
 											float[] mrv = MultipleResolutionComparison(simulationMap);	//perform the MRV
 											for(int i = 0;i < mrv.length;i++){
-												statusOut.println(mrv[i]);
+												//statusOut.println(mrv[i]);
 												mrvTempResultArray[i] += mrv[i];
 											}
 										}
 									}	//END OF THE TIME STEPS
 									
 									if (MC == MonteCarlo){
-										SumOutStep.addGrid();	//add a final raster to the GridList (contains the sum of all iterations)
+										//SumOutStep.addGrid();	//add a final raster to the GridList (contains the sum of all iterations)
 										
 										//statusOut.println("Step Grids: "+outStep.getGridCount());
 										
@@ -399,7 +399,7 @@
 													float tempUrb = (Float) outStep.getGrid(gridNo).getRasterSample(x,y);	//take the pixel value
 													sumUrb  += tempUrb;		//and add its value
 												}
-												SumOutStep.getGrid(runs-1).setRasterSample(sumUrb,x,y);	//put the layer in the raster list containing the step results
+												//SumOutStep.getGrid(runs-1).setRasterSample(sumUrb,x,y);	//put the layer in the raster list containing the step results
 											}
 										}
 										
@@ -427,10 +427,25 @@
 								}	System.out.println("");
 								
 								//END OF THE MONTE CARLO ITERATIONS
+								if (roadGravity == 1 && roadGravityStep != 1){		//Coefficients set to 0 if starting with 1. If step is 1, it is not set to 0, because endless loop otherwise.
+									roadGravity = 0;
+								}
 							}	//END OF ROADGRAVITY COMBINATION
+						if (breed == 1 && breedStep != 1){
+							breed = 0;
+						}
 						}	//END OF BREED COMBINATION
+					if (disp == 1 && dispStep != 1){
+						disp = 0;
+					}
 					}	//END OF DISP COMBINATION
+				if (spread == 1 && spreadStep != 1){
+					spread = 0;
+				}
 				}	//END OF SPREAD COMBINATION
+			if (slope == 1 && slopeStep != 1){
+				slope = 0;
+			}
 			}	//END OF SLOPE COMBINATION
 			System.out.println("Finished "  + " in " + ((System.currentTimeMillis() - localStartTime)) + " ms\n");
 		}	//END OF MODEL STEP

Modified: trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationSelfModificationContentManager.java
===================================================================
--- trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationSelfModificationContentManager.java	2012-05-24 09:02:42 UTC (rev 125)
+++ trunk/src/edu/bonn/xulu/plugin/model/sleuth/UrbanGrowthModelCalibrationSelfModificationContentManager.java	2013-04-26 15:42:11 UTC (rev 126)
@@ -11,12 +11,12 @@
 	public UrbanGrowthModelCalibrationSelfModificationContentManager(int additionalRes) {
 		super(6+additionalRes);
 	    
-		resource[27]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Road Gravity Sensitivity",ScalarProperty.class,Double.class,false);
-	    resource[28]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Slope Sensitivity",ScalarProperty.class,Double.class,false);
-	    resource[29]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Critical Low",ScalarProperty.class,Double.class,false);
-	    resource[30]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Critical High",ScalarProperty.class,Double.class,false);
-	    resource[31]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Boom",ScalarProperty.class,Double.class,false);
-	    resource[32]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Bust",ScalarProperty.class,Double.class,false);
+		resource[25]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Road Gravity Sensitivity",ScalarProperty.class,Double.class,false);
+	    resource[26]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Slope Sensitivity",ScalarProperty.class,Double.class,false);
+	    resource[27]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Critical Low",ScalarProperty.class,Double.class,false);
+	    resource[28]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Critical High",ScalarProperty.class,Double.class,false);
+	    resource[29]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Boom",ScalarProperty.class,Double.class,false);
+	    resource[30]= new ValuePropertyResource(ModelResource.CATEGORY_INPUT,"Bust",ScalarProperty.class,Double.class,false);
 
 	 	// ===== Ressourcen Bezeichnungen lokalisieren =====
 	    resetCaptions(null);



More information about the Xulu-commits mailing list