Merging evolving disease branch into master
diff --git a/core/org.eclipse.stem.core/src/org/eclipse/stem/adapters/file/File.java b/core/org.eclipse.stem.core/src/org/eclipse/stem/adapters/file/File.java
index 41e1c9d..246c285 100644
--- a/core/org.eclipse.stem.core/src/org/eclipse/stem/adapters/file/File.java
+++ b/core/org.eclipse.stem.core/src/org/eclipse/stem/adapters/file/File.java
@@ -18,7 +18,7 @@
public interface File {
- public XMIResource getResource();
+ public XMIResource getResource();
public Identifiable getIdentifiable();
diff --git a/core/org.eclipse.stem.gis/src/org/eclipse/stem/gis/shp/ShpInputStream.java b/core/org.eclipse.stem.gis/src/org/eclipse/stem/gis/shp/ShpInputStream.java
index 03c7635..a6dec34 100644
--- a/core/org.eclipse.stem.gis/src/org/eclipse/stem/gis/shp/ShpInputStream.java
+++ b/core/org.eclipse.stem.gis/src/org/eclipse/stem/gis/shp/ShpInputStream.java
@@ -301,7 +301,8 @@
}
for (int column = 0; column < columns; column++) {
- for (int row = 0; row < rows; row+=2) {
+
+ for (int row = 0; row < rows; row+=rows) {
Point2D pt = readPointAndProject();
points[row][column] = pt.getX();
@@ -315,6 +316,16 @@
return points;
}
+ protected double[] readPoints(int pointCount) throws IOException
+ {
+ double[] points = new double[pointCount];
+
+ for (int row = 0; row < pointCount; row++) {
+ points[row] = readDouble();
+ }
+
+ return points;
+ }
protected Point2D transform(double x, double y)
{
@@ -391,16 +402,16 @@
protected void readMeasures(Part[] parts) throws IOException
{
for (int idx=0; idx<parts.length; idx++) {
- double[][] pts = readAndWeavePoints(1, parts[idx].getPointCount());
- parts[idx].setMs(pts[0]);
+ double[] pts = readPoints(parts[idx].getPointCount());
+ parts[idx].setMs(pts);
}
}
protected void readZCoordinates(Part[] parts) throws IOException
{
for (int idx=0; idx<parts.length; idx++) {
- double[][] pts = readAndWeavePoints(1, parts[idx].getPointCount());
- parts[idx].setZs(pts[0]);
+ double[] pts = readPoints(parts[idx].getPointCount());
+ parts[idx].setZs(pts);
}
}
diff --git a/core/org.eclipse.stem.graphgenerators/src/org/eclipse/stem/graphgenerators/impl/ShapefileGraphGeneratorImpl.java b/core/org.eclipse.stem.graphgenerators/src/org/eclipse/stem/graphgenerators/impl/ShapefileGraphGeneratorImpl.java
index 1726d1d..9b4a845 100644
--- a/core/org.eclipse.stem.graphgenerators/src/org/eclipse/stem/graphgenerators/impl/ShapefileGraphGeneratorImpl.java
+++ b/core/org.eclipse.stem.graphgenerators/src/org/eclipse/stem/graphgenerators/impl/ShapefileGraphGeneratorImpl.java
@@ -1,5 +1,5 @@
/*******************************************************************************
- * Copyright (c) 2012 Bundesinstitut f?r Risikobewertung.
+ * Copyright (c) 2016 Bundesinstitut f?r Risikobewertung.
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
@@ -50,6 +50,8 @@
import org.eclipse.stem.definitions.nodes.Region;
import org.eclipse.stem.gis.shp.ShpPolyLine;
import org.eclipse.stem.gis.shp.ShpPolygon;
+import org.eclipse.stem.gis.shp.ShpPolygonM;
+import org.eclipse.stem.gis.shp.ShpPolygonZ;
import org.eclipse.stem.gis.shp.ShpRecord;
import org.eclipse.stem.gis.shp.type.Box;
import org.eclipse.stem.gis.shp.type.Part;
@@ -75,6 +77,7 @@
*/
public class ShapefileGraphGeneratorImpl extends GraphGeneratorImpl implements
ShapefileGraphGenerator {
+
/**
* The cached value of the '{@link #getShapefiles() <em>Shapefiles</em>}' reference list.
* <!-- begin-user-doc --> <!-- end-user-doc -->
@@ -173,7 +176,7 @@
public Graph getGraph() {
Graph graph = GraphFactory.eINSTANCE.createGraph();
List<Node> nodeList = new ArrayList<Node>();
- List<ShpPolygon> polygonList = new ArrayList<ShpPolygon>();
+ List<ShpPolyLine> polygonList = new ArrayList<ShpPolyLine>();
DublinCore dc = graph.getDublinCore();
Calendar c = Calendar.getInstance();
SimpleDateFormat formatter = new SimpleDateFormat(
@@ -207,7 +210,7 @@
* created polygons are added to this list
*/
private void processRegionShapefiles(Graph graph, List<Node> nodeList,
- List<ShpPolygon> polygonList) {
+ List<ShpPolyLine> polygonList) {
for (Shapefile s : shapefiles) {
if (!(s instanceof RegionShapefile)) {
continue;
@@ -237,8 +240,8 @@
for (int i = 0; i < shapeList.size(); i++) {
ShpRecord shape = shapeList.get(i);
- if (shape instanceof ShpPolygon) {
- ShpPolygon polygon = (ShpPolygon) shape;
+ if (shape instanceof ShpPolygon || shape instanceof ShpPolygonM || shape instanceof ShpPolygonZ) {
+ ShpPolyLine polygon = (ShpPolyLine) shape;
adjustNumberOfFractionalDigits(polygon);
@@ -365,7 +368,7 @@
* list of all polygons created by processRegionShapefiles
*/
private void processRoadShapefiles(Graph graph, List<Node> nodeList,
- List<ShpPolygon> polygonList) {
+ List<ShpPolyLine> polygonList) {
for (Shapefile s : shapefiles) {
if (!(s instanceof RoadShapefile)) {
continue;
@@ -446,7 +449,7 @@
* list of all polygons created by processRegionShapefiles
*/
private void processMigrationShapefiles(Graph graph, List<Node> nodeList,
- List<ShpPolygon> polygonList) {
+ List<ShpPolyLine> polygonList) {
for (Shapefile s : shapefiles) {
if (!(s instanceof MigrationShapefile)) {
continue;
@@ -539,11 +542,11 @@
* list of all polygons created by processRegionShapefiles
*/
private void processCommonBorderCreation(Graph graph,
- List<Node> nodeHolder, List<ShpPolygon> polygonList) {
+ List<Node> nodeHolder, List<ShpPolyLine> polygonList) {
int n = polygonList.size();
List<Rectangle2D> boundingBoxList = new ArrayList<Rectangle2D>(n);
- for (ShpPolygon p : polygonList) {
+ for (ShpPolyLine p : polygonList) {
Box b = p.getBoundingBox();
boundingBoxList.add(new Rectangle2D.Double(b.getXMin(),
@@ -583,7 +586,7 @@
* and number of crossing as value
*/
private Map<Point, Integer> getCrossings(ShpPolyLine polyline,
- List<ShpPolygon> polygonList) {
+ List<ShpPolyLine> polygonList) {
Map<Point, Integer> crossings = new HashMap<Point, Integer>();
for (Part p : polyline.getParts()) {
double[] xs = p.getXs();
@@ -632,9 +635,9 @@
* @return index of the polygon that contains the point
*/
private int getContainingPolygon(double x, double y,
- List<ShpPolygon> esriPolygonLists, int guess) {
+ List<ShpPolyLine> esriPolygonLists, int guess) {
if (guess != -1) {
- ShpPolygon list = esriPolygonLists.get(guess);
+ ShpPolyLine list = esriPolygonLists.get(guess);
for (Part p : list.getParts()) {
if (isPointInPolygon(x, y, p)) {
@@ -644,7 +647,7 @@
}
for (int i = 0; i < esriPolygonLists.size(); i++) {
- ShpPolygon list = esriPolygonLists.get(i);
+ ShpPolyLine list = esriPolygonLists.get(i);
if (i == guess) {
continue;
@@ -667,7 +670,7 @@
* polygon to convert
* @return STEM-type polygon
*/
- private LatLong createSTEMPolygon(ShpPolygon polygon) {
+ private LatLong createSTEMPolygon(ShpPolyLine polygon) {
LatLong retValue = new LatLong();
for (Part p : polygon.getParts()) {
@@ -843,7 +846,7 @@
* second polygon
* @return length of the common border
*/
- private double commonBorderLength(ShpPolygon a, ShpPolygon b) {
+ private double commonBorderLength(ShpPolyLine a, ShpPolyLine b) {
double border_length = 0;
Set<Point2D.Double> bPoints = new HashSet<Point2D.Double>();
diff --git a/models/epidemiology/org.eclipse.stem.diseasemodels.vector/src/org/eclipse/stem/diseasemodels/vector/impl/MacdonaldRossDiseaseModelImpl.java b/models/epidemiology/org.eclipse.stem.diseasemodels.vector/src/org/eclipse/stem/diseasemodels/vector/impl/MacdonaldRossDiseaseModelImpl.java
index 2a993ab..b8c685c 100644
--- a/models/epidemiology/org.eclipse.stem.diseasemodels.vector/src/org/eclipse/stem/diseasemodels/vector/impl/MacdonaldRossDiseaseModelImpl.java
+++ b/models/epidemiology/org.eclipse.stem.diseasemodels.vector/src/org/eclipse/stem/diseasemodels/vector/impl/MacdonaldRossDiseaseModelImpl.java
@@ -651,6 +651,7 @@
// we have temperature data available and if so, use that instead of the
// rate specified in the model
+ /* Commented out 3/6/16 since this is a generic MacDonald Ross model and not Malaria per say
for(NodeLabel nl:n.getLabels()) {
if(nl instanceof EarthScienceLabel && ((EarthScienceLabel)nl).getCurrentEarthScienceValue().getDataType().equals("nighttemp")) {
Calendar c = Calendar.getInstance();
@@ -682,7 +683,12 @@
break;
}
}
-
+*/
+
+ // For Philippines workshop
+ adjustedVectorIncubationRate = this.getVectorIncubationRate()*((double)timeDelta / (double)getTimePeriod());
+
+
final double effectiveInfectiousHuman = getNormalizedEffectiveInfectious(humanPop.getNode(), humanPop, seirVal.getI(), StandardPackage.Literals.SI_LABEL_VALUE__I, StandardPackage.Literals.STANDARD_DISEASE_MODEL__CHARACTERISTIC_MIXING_DISTANCE, StandardPackage.Literals.STANDARD_DISEASE_MODEL__ROAD_NETWORK_INFECTIOUS_PROPORTION);