From 86518413bed5988092b30d1139bb72ef302ae09c Mon Sep 17 00:00:00 2001
From: Aren Babikian
Date: Sun, 17 Jan 2021 01:16:26 -0500
Subject: complete queries for lane structure
---
Domains/crossingScenario/.gitignore | 1 +
.../crossingScenario/CrossingScenario.java | 46 ++++
.../crossingScenario/CrossingScenarioFactory.java | 27 +-
.../crossingScenario/CrossingScenarioPackage.java | 274 +++++++++++++++++----
.../ecore-gen/crossingScenario/Lane.java | 28 +--
.../crossingScenario/Lane_Horizontal.java | 17 ++
.../ecore-gen/crossingScenario/Lane_Vertical.java | 17 ++
.../impl/CrossingScenarioFactoryImpl.java | 32 +--
.../impl/CrossingScenarioImpl.java | 126 ++++++++++
.../impl/CrossingScenarioPackageImpl.java | 77 ++++--
.../ecore-gen/crossingScenario/impl/LaneImpl.java | 61 +----
.../crossingScenario/impl/Lane_HorizontalImpl.java | 37 +++
.../crossingScenario/impl/Lane_VerticalImpl.java | 37 +++
.../util/CrossingScenarioAdapterFactory.java | 36 +++
.../util/CrossingScenarioSwitch.java | 44 ++++
.../inputs/crossingScenarioGen.vsconfig | 11 +-
.../crossingScenario/model/crossingScenario.aird | 270 ++++++++++++--------
.../crossingScenario/model/crossingScenario.ecore | 14 +-
.../model/crossingScenario.genmodel | 9 +-
.../queries/crossingScenarioQueries.vql | 167 +++++++++----
.../crossingScenario/run/CrossingScenarioMain.java | 8 +-
.../src/crossingScenario/run/QueryDebug.java | 135 +++++++---
22 files changed, 1084 insertions(+), 390 deletions(-)
create mode 100644 Domains/crossingScenario/ecore-gen/crossingScenario/Lane_Horizontal.java
create mode 100644 Domains/crossingScenario/ecore-gen/crossingScenario/Lane_Vertical.java
create mode 100644 Domains/crossingScenario/ecore-gen/crossingScenario/impl/Lane_HorizontalImpl.java
create mode 100644 Domains/crossingScenario/ecore-gen/crossingScenario/impl/Lane_VerticalImpl.java
(limited to 'Domains/crossingScenario')
diff --git a/Domains/crossingScenario/.gitignore b/Domains/crossingScenario/.gitignore
index 0370ac06..4c033661 100644
--- a/Domains/crossingScenario/.gitignore
+++ b/Domains/crossingScenario/.gitignore
@@ -2,3 +2,4 @@
/outputs/
/src-gen/
/xtend-gen/
+/src/queries/
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenario.java b/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenario.java
index afbe34e7..b4f01423 100644
--- a/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenario.java
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenario.java
@@ -20,6 +20,8 @@ import org.eclipse.emf.ecore.EObject;
* {@link crossingScenario.CrossingScenario#getActors Actors}
* {@link crossingScenario.CrossingScenario#getLanes Lanes}
* {@link crossingScenario.CrossingScenario#getMaxTime Max Time}
+ * {@link crossingScenario.CrossingScenario#getHorizontal_head Horizontal head}
+ * {@link crossingScenario.CrossingScenario#getVertical_head Vertical head}
*
*
* @see crossingScenario.CrossingScenarioPackage#getCrossingScenario()
@@ -117,4 +119,48 @@ public interface CrossingScenario extends EObject {
*/
void setMaxTime(double value);
+ /**
+ * Returns the value of the 'Horizontal head' reference.
+ *
+ *
+ * @return the value of the 'Horizontal head' reference.
+ * @see #setHorizontal_head(Lane_Horizontal)
+ * @see crossingScenario.CrossingScenarioPackage#getCrossingScenario_Horizontal_head()
+ * @model required="true"
+ * @generated
+ */
+ Lane_Horizontal getHorizontal_head();
+
+ /**
+ * Sets the value of the '{@link crossingScenario.CrossingScenario#getHorizontal_head Horizontal head}' reference.
+ *
+ *
+ * @param value the new value of the 'Horizontal head' reference.
+ * @see #getHorizontal_head()
+ * @generated
+ */
+ void setHorizontal_head(Lane_Horizontal value);
+
+ /**
+ * Returns the value of the 'Vertical head' reference.
+ *
+ *
+ * @return the value of the 'Vertical head' reference.
+ * @see #setVertical_head(Lane_Vertical)
+ * @see crossingScenario.CrossingScenarioPackage#getCrossingScenario_Vertical_head()
+ * @model required="true"
+ * @generated
+ */
+ Lane_Vertical getVertical_head();
+
+ /**
+ * Sets the value of the '{@link crossingScenario.CrossingScenario#getVertical_head Vertical head}' reference.
+ *
+ *
+ * @param value the new value of the 'Vertical head' reference.
+ * @see #getVertical_head()
+ * @generated
+ */
+ void setVertical_head(Lane_Vertical value);
+
} // CrossingScenario
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenarioFactory.java b/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenarioFactory.java
index b281559c..8ac3df81 100644
--- a/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenarioFactory.java
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenarioFactory.java
@@ -30,15 +30,6 @@ public interface CrossingScenarioFactory extends EFactory {
*/
CrossingScenario createCrossingScenario();
- /**
- * Returns a new object of class 'Lane'.
- *
- *
- * @return a new object of class 'Lane'.
- * @generated
- */
- Lane createLane();
-
/**
* Returns a new object of class 'Vision Blocked'.
*
@@ -93,6 +84,24 @@ public interface CrossingScenarioFactory extends EFactory {
*/
Vehicle createVehicle();
+ /**
+ * Returns a new object of class 'Lane Horizontal'.
+ *
+ *
+ * @return a new object of class 'Lane Horizontal'.
+ * @generated
+ */
+ Lane_Horizontal createLane_Horizontal();
+
+ /**
+ * Returns a new object of class 'Lane Vertical'.
+ *
+ *
+ * @return a new object of class 'Lane Vertical'.
+ * @generated
+ */
+ Lane_Vertical createLane_Vertical();
+
/**
* Returns the package supported by this factory.
*
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenarioPackage.java b/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenarioPackage.java
index c690a23c..813466ef 100644
--- a/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenarioPackage.java
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/CrossingScenarioPackage.java
@@ -113,41 +113,50 @@ public interface CrossingScenarioPackage extends EPackage {
int CROSSING_SCENARIO__MAX_TIME = 4;
/**
- * The number of structural features of the 'Crossing Scenario' class.
+ * The feature id for the 'Horizontal head' reference.
*
*
* @generated
* @ordered
*/
- int CROSSING_SCENARIO_FEATURE_COUNT = 5;
+ int CROSSING_SCENARIO__HORIZONTAL_HEAD = 5;
/**
- * The number of operations of the 'Crossing Scenario' class.
+ * The feature id for the 'Vertical head' reference.
*
*
* @generated
* @ordered
*/
- int CROSSING_SCENARIO_OPERATION_COUNT = 0;
+ int CROSSING_SCENARIO__VERTICAL_HEAD = 6;
/**
- * The meta object id for the '{@link crossingScenario.impl.LaneImpl Lane}' class.
+ * The number of structural features of the 'Crossing Scenario' class.
*
*
- * @see crossingScenario.impl.LaneImpl
- * @see crossingScenario.impl.CrossingScenarioPackageImpl#getLane()
* @generated
+ * @ordered
*/
- int LANE = 1;
+ int CROSSING_SCENARIO_FEATURE_COUNT = 7;
/**
- * The feature id for the 'Orientation' attribute.
+ * The number of operations of the 'Crossing Scenario' class.
*
*
* @generated
* @ordered
*/
- int LANE__ORIENTATION = 0;
+ int CROSSING_SCENARIO_OPERATION_COUNT = 0;
+
+ /**
+ * The meta object id for the '{@link crossingScenario.impl.LaneImpl Lane}' class.
+ *
+ *
+ * @see crossingScenario.impl.LaneImpl
+ * @see crossingScenario.impl.CrossingScenarioPackageImpl#getLane()
+ * @generated
+ */
+ int LANE = 1;
/**
* The feature id for the 'Width' attribute.
@@ -156,7 +165,7 @@ public interface CrossingScenarioPackage extends EPackage {
* @generated
* @ordered
*/
- int LANE__WIDTH = 1;
+ int LANE__WIDTH = 0;
/**
* The feature id for the 'Reference Coord' attribute.
@@ -165,7 +174,7 @@ public interface CrossingScenarioPackage extends EPackage {
* @generated
* @ordered
*/
- int LANE__REFERENCE_COORD = 2;
+ int LANE__REFERENCE_COORD = 1;
/**
* The feature id for the 'Prev Lane' reference.
@@ -174,7 +183,7 @@ public interface CrossingScenarioPackage extends EPackage {
* @generated
* @ordered
*/
- int LANE__PREV_LANE = 3;
+ int LANE__PREV_LANE = 2;
/**
* The feature id for the 'Actors' reference list.
@@ -183,7 +192,7 @@ public interface CrossingScenarioPackage extends EPackage {
* @generated
* @ordered
*/
- int LANE__ACTORS = 4;
+ int LANE__ACTORS = 3;
/**
* The feature id for the 'Num Width' attribute.
@@ -192,7 +201,7 @@ public interface CrossingScenarioPackage extends EPackage {
* @generated
* @ordered
*/
- int LANE__NUM_WIDTH = 5;
+ int LANE__NUM_WIDTH = 4;
/**
* The number of structural features of the 'Lane' class.
@@ -201,7 +210,7 @@ public interface CrossingScenarioPackage extends EPackage {
* @generated
* @ordered
*/
- int LANE_FEATURE_COUNT = 6;
+ int LANE_FEATURE_COUNT = 5;
/**
* The number of operations of the 'Lane' class.
@@ -799,14 +808,150 @@ public interface CrossingScenarioPackage extends EPackage {
int VEHICLE_OPERATION_COUNT = ACTOR_OPERATION_COUNT + 0;
/**
- * The meta object id for the '{@link crossingScenario.Orientation Orientation}' enum.
+ * The meta object id for the '{@link crossingScenario.impl.Lane_HorizontalImpl Lane Horizontal}' class.
+ *
+ *
+ * @see crossingScenario.impl.Lane_HorizontalImpl
+ * @see crossingScenario.impl.CrossingScenarioPackageImpl#getLane_Horizontal()
+ * @generated
+ */
+ int LANE_HORIZONTAL = 12;
+
+ /**
+ * The feature id for the 'Width' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_HORIZONTAL__WIDTH = LANE__WIDTH;
+
+ /**
+ * The feature id for the 'Reference Coord' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_HORIZONTAL__REFERENCE_COORD = LANE__REFERENCE_COORD;
+
+ /**
+ * The feature id for the 'Prev Lane' reference.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_HORIZONTAL__PREV_LANE = LANE__PREV_LANE;
+
+ /**
+ * The feature id for the 'Actors' reference list.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_HORIZONTAL__ACTORS = LANE__ACTORS;
+
+ /**
+ * The feature id for the 'Num Width' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_HORIZONTAL__NUM_WIDTH = LANE__NUM_WIDTH;
+
+ /**
+ * The number of structural features of the 'Lane Horizontal' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_HORIZONTAL_FEATURE_COUNT = LANE_FEATURE_COUNT + 0;
+
+ /**
+ * The number of operations of the 'Lane Horizontal' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_HORIZONTAL_OPERATION_COUNT = LANE_OPERATION_COUNT + 0;
+
+ /**
+ * The meta object id for the '{@link crossingScenario.impl.Lane_VerticalImpl Lane Vertical}' class.
+ *
+ *
+ * @see crossingScenario.impl.Lane_VerticalImpl
+ * @see crossingScenario.impl.CrossingScenarioPackageImpl#getLane_Vertical()
+ * @generated
+ */
+ int LANE_VERTICAL = 13;
+
+ /**
+ * The feature id for the 'Width' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_VERTICAL__WIDTH = LANE__WIDTH;
+
+ /**
+ * The feature id for the 'Reference Coord' attribute.
*
*
- * @see crossingScenario.Orientation
- * @see crossingScenario.impl.CrossingScenarioPackageImpl#getOrientation()
* @generated
+ * @ordered
*/
- int ORIENTATION = 12;
+ int LANE_VERTICAL__REFERENCE_COORD = LANE__REFERENCE_COORD;
+
+ /**
+ * The feature id for the 'Prev Lane' reference.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_VERTICAL__PREV_LANE = LANE__PREV_LANE;
+
+ /**
+ * The feature id for the 'Actors' reference list.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_VERTICAL__ACTORS = LANE__ACTORS;
+
+ /**
+ * The feature id for the 'Num Width' attribute.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_VERTICAL__NUM_WIDTH = LANE__NUM_WIDTH;
+
+ /**
+ * The number of structural features of the 'Lane Vertical' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_VERTICAL_FEATURE_COUNT = LANE_FEATURE_COUNT + 0;
+
+ /**
+ * The number of operations of the 'Lane Vertical' class.
+ *
+ *
+ * @generated
+ * @ordered
+ */
+ int LANE_VERTICAL_OPERATION_COUNT = LANE_OPERATION_COUNT + 0;
/**
* The meta object id for the '{@link crossingScenario.Size Size}' enum.
@@ -816,7 +961,7 @@ public interface CrossingScenarioPackage extends EPackage {
* @see crossingScenario.impl.CrossingScenarioPackageImpl#getSize()
* @generated
*/
- int SIZE = 13;
+ int SIZE = 14;
/**
* The meta object id for the '{@link crossingScenario.Distance Distance}' enum.
@@ -826,7 +971,7 @@ public interface CrossingScenarioPackage extends EPackage {
* @see crossingScenario.impl.CrossingScenarioPackageImpl#getDistance()
* @generated
*/
- int DISTANCE = 14;
+ int DISTANCE = 15;
/**
@@ -895,25 +1040,36 @@ public interface CrossingScenarioPackage extends EPackage {
EAttribute getCrossingScenario_MaxTime();
/**
- * Returns the meta object for class '{@link crossingScenario.Lane Lane}'.
+ * Returns the meta object for the reference '{@link crossingScenario.CrossingScenario#getHorizontal_head Horizontal head}'.
*
*
- * @return the meta object for class 'Lane'.
- * @see crossingScenario.Lane
+ * @return the meta object for the reference 'Horizontal head'.
+ * @see crossingScenario.CrossingScenario#getHorizontal_head()
+ * @see #getCrossingScenario()
* @generated
*/
- EClass getLane();
+ EReference getCrossingScenario_Horizontal_head();
/**
- * Returns the meta object for the attribute '{@link crossingScenario.Lane#getOrientation Orientation}'.
+ * Returns the meta object for the reference '{@link crossingScenario.CrossingScenario#getVertical_head Vertical head}'.
*
*
- * @return the meta object for the attribute 'Orientation'.
- * @see crossingScenario.Lane#getOrientation()
- * @see #getLane()
+ * @return the meta object for the reference 'Vertical head'.
+ * @see crossingScenario.CrossingScenario#getVertical_head()
+ * @see #getCrossingScenario()
+ * @generated
+ */
+ EReference getCrossingScenario_Vertical_head();
+
+ /**
+ * Returns the meta object for class '{@link crossingScenario.Lane Lane}'.
+ *
+ *
+ * @return the meta object for class 'Lane'.
+ * @see crossingScenario.Lane
* @generated
*/
- EAttribute getLane_Orientation();
+ EClass getLane();
/**
* Returns the meta object for the attribute '{@link crossingScenario.Lane#getWidth Width}'.
@@ -1203,14 +1359,24 @@ public interface CrossingScenarioPackage extends EPackage {
EClass getVehicle();
/**
- * Returns the meta object for enum '{@link crossingScenario.Orientation Orientation}'.
+ * Returns the meta object for class '{@link crossingScenario.Lane_Horizontal Lane Horizontal}'.
+ *
+ *
+ * @return the meta object for class 'Lane Horizontal'.
+ * @see crossingScenario.Lane_Horizontal
+ * @generated
+ */
+ EClass getLane_Horizontal();
+
+ /**
+ * Returns the meta object for class '{@link crossingScenario.Lane_Vertical Lane Vertical}'.
*
*
- * @return the meta object for enum 'Orientation'.
- * @see crossingScenario.Orientation
+ * @return the meta object for class 'Lane Vertical'.
+ * @see crossingScenario.Lane_Vertical
* @generated
*/
- EEnum getOrientation();
+ EClass getLane_Vertical();
/**
* Returns the meta object for enum '{@link crossingScenario.Size Size}'.
@@ -1306,22 +1472,30 @@ public interface CrossingScenarioPackage extends EPackage {
EAttribute CROSSING_SCENARIO__MAX_TIME = eINSTANCE.getCrossingScenario_MaxTime();
/**
- * The meta object literal for the '{@link crossingScenario.impl.LaneImpl Lane}' class.
+ * The meta object literal for the 'Horizontal head' reference feature.
*
*
- * @see crossingScenario.impl.LaneImpl
- * @see crossingScenario.impl.CrossingScenarioPackageImpl#getLane()
* @generated
*/
- EClass LANE = eINSTANCE.getLane();
+ EReference CROSSING_SCENARIO__HORIZONTAL_HEAD = eINSTANCE.getCrossingScenario_Horizontal_head();
+
+ /**
+ * The meta object literal for the 'Vertical head' reference feature.
+ *
+ *
+ * @generated
+ */
+ EReference CROSSING_SCENARIO__VERTICAL_HEAD = eINSTANCE.getCrossingScenario_Vertical_head();
/**
- * The meta object literal for the 'Orientation' attribute feature.
+ * The meta object literal for the '{@link crossingScenario.impl.LaneImpl Lane}' class.
*
*
+ * @see crossingScenario.impl.LaneImpl
+ * @see crossingScenario.impl.CrossingScenarioPackageImpl#getLane()
* @generated
*/
- EAttribute LANE__ORIENTATION = eINSTANCE.getLane_Orientation();
+ EClass LANE = eINSTANCE.getLane();
/**
* The meta object literal for the 'Width' attribute feature.
@@ -1560,14 +1734,24 @@ public interface CrossingScenarioPackage extends EPackage {
EClass VEHICLE = eINSTANCE.getVehicle();
/**
- * The meta object literal for the '{@link crossingScenario.Orientation Orientation}' enum.
+ * The meta object literal for the '{@link crossingScenario.impl.Lane_HorizontalImpl Lane Horizontal}' class.
+ *
+ *
+ * @see crossingScenario.impl.Lane_HorizontalImpl
+ * @see crossingScenario.impl.CrossingScenarioPackageImpl#getLane_Horizontal()
+ * @generated
+ */
+ EClass LANE_HORIZONTAL = eINSTANCE.getLane_Horizontal();
+
+ /**
+ * The meta object literal for the '{@link crossingScenario.impl.Lane_VerticalImpl Lane Vertical}' class.
*
*
- * @see crossingScenario.Orientation
- * @see crossingScenario.impl.CrossingScenarioPackageImpl#getOrientation()
+ * @see crossingScenario.impl.Lane_VerticalImpl
+ * @see crossingScenario.impl.CrossingScenarioPackageImpl#getLane_Vertical()
* @generated
*/
- EEnum ORIENTATION = eINSTANCE.getOrientation();
+ EClass LANE_VERTICAL = eINSTANCE.getLane_Vertical();
/**
* The meta object literal for the '{@link crossingScenario.Size Size}' enum.
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/Lane.java b/Domains/crossingScenario/ecore-gen/crossingScenario/Lane.java
index fd04b3c9..d27cf644 100644
--- a/Domains/crossingScenario/ecore-gen/crossingScenario/Lane.java
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/Lane.java
@@ -15,7 +15,6 @@ import org.eclipse.emf.ecore.EObject;
* The following features are supported:
*
*
- * - {@link crossingScenario.Lane#getOrientation Orientation}
* - {@link crossingScenario.Lane#getWidth Width}
* - {@link crossingScenario.Lane#getReferenceCoord Reference Coord}
* - {@link crossingScenario.Lane#getPrevLane Prev Lane}
@@ -24,35 +23,10 @@ import org.eclipse.emf.ecore.EObject;
*
*
* @see crossingScenario.CrossingScenarioPackage#getLane()
- * @model
+ * @model abstract="true"
* @generated
*/
public interface Lane extends EObject {
- /**
- * Returns the value of the 'Orientation' attribute.
- * The literals are from the enumeration {@link crossingScenario.Orientation}.
- *
- *
- * @return the value of the 'Orientation' attribute.
- * @see crossingScenario.Orientation
- * @see #setOrientation(Orientation)
- * @see crossingScenario.CrossingScenarioPackage#getLane_Orientation()
- * @model required="true"
- * @generated
- */
- Orientation getOrientation();
-
- /**
- * Sets the value of the '{@link crossingScenario.Lane#getOrientation Orientation}' attribute.
- *
- *
- * @param value the new value of the 'Orientation' attribute.
- * @see crossingScenario.Orientation
- * @see #getOrientation()
- * @generated
- */
- void setOrientation(Orientation value);
-
/**
* Returns the value of the 'Width' attribute.
* The literals are from the enumeration {@link crossingScenario.Size}.
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/Lane_Horizontal.java b/Domains/crossingScenario/ecore-gen/crossingScenario/Lane_Horizontal.java
new file mode 100644
index 00000000..aec6413e
--- /dev/null
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/Lane_Horizontal.java
@@ -0,0 +1,17 @@
+/**
+ */
+package crossingScenario;
+
+
+/**
+ *
+ * A representation of the model object 'Lane Horizontal'.
+ *
+ *
+ *
+ * @see crossingScenario.CrossingScenarioPackage#getLane_Horizontal()
+ * @model
+ * @generated
+ */
+public interface Lane_Horizontal extends Lane {
+} // Lane_Horizontal
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/Lane_Vertical.java b/Domains/crossingScenario/ecore-gen/crossingScenario/Lane_Vertical.java
new file mode 100644
index 00000000..cf818bc2
--- /dev/null
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/Lane_Vertical.java
@@ -0,0 +1,17 @@
+/**
+ */
+package crossingScenario;
+
+
+/**
+ *
+ * A representation of the model object 'Lane Vertical'.
+ *
+ *
+ *
+ * @see crossingScenario.CrossingScenarioPackage#getLane_Vertical()
+ * @model
+ * @generated
+ */
+public interface Lane_Vertical extends Lane {
+} // Lane_Vertical
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioFactoryImpl.java b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioFactoryImpl.java
index 6e5bab16..ee407bc5 100644
--- a/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioFactoryImpl.java
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioFactoryImpl.java
@@ -58,13 +58,14 @@ public class CrossingScenarioFactoryImpl extends EFactoryImpl implements Crossin
public EObject create(EClass eClass) {
switch (eClass.getClassifierID()) {
case CrossingScenarioPackage.CROSSING_SCENARIO: return createCrossingScenario();
- case CrossingScenarioPackage.LANE: return createLane();
case CrossingScenarioPackage.VISION_BLOCKED: return createVisionBlocked();
case CrossingScenarioPackage.SEPARATION_DISTANCE: return createSeparationDistance();
case CrossingScenarioPackage.COLLISION_EXISTS: return createCollisionExists();
case CrossingScenarioPackage.COLLISION_DOES_NOT_EXIST: return createCollisionDoesNotExist();
case CrossingScenarioPackage.PEDESTRIAN: return createPedestrian();
case CrossingScenarioPackage.VEHICLE: return createVehicle();
+ case CrossingScenarioPackage.LANE_HORIZONTAL: return createLane_Horizontal();
+ case CrossingScenarioPackage.LANE_VERTICAL: return createLane_Vertical();
default:
throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
}
@@ -78,8 +79,6 @@ public class CrossingScenarioFactoryImpl extends EFactoryImpl implements Crossin
@Override
public Object createFromString(EDataType eDataType, String initialValue) {
switch (eDataType.getClassifierID()) {
- case CrossingScenarioPackage.ORIENTATION:
- return createOrientationFromString(eDataType, initialValue);
case CrossingScenarioPackage.SIZE:
return createSizeFromString(eDataType, initialValue);
case CrossingScenarioPackage.DISTANCE:
@@ -97,8 +96,6 @@ public class CrossingScenarioFactoryImpl extends EFactoryImpl implements Crossin
@Override
public String convertToString(EDataType eDataType, Object instanceValue) {
switch (eDataType.getClassifierID()) {
- case CrossingScenarioPackage.ORIENTATION:
- return convertOrientationToString(eDataType, instanceValue);
case CrossingScenarioPackage.SIZE:
return convertSizeToString(eDataType, instanceValue);
case CrossingScenarioPackage.DISTANCE:
@@ -119,17 +116,6 @@ public class CrossingScenarioFactoryImpl extends EFactoryImpl implements Crossin
return crossingScenario;
}
- /**
- *
- *
- * @generated
- */
- @Override
- public Lane createLane() {
- LaneImpl lane = new LaneImpl();
- return lane;
- }
-
/**
*
*
@@ -201,10 +187,10 @@ public class CrossingScenarioFactoryImpl extends EFactoryImpl implements Crossin
*
* @generated
*/
- public Orientation createOrientationFromString(EDataType eDataType, String initialValue) {
- Orientation result = Orientation.get(initialValue);
- if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'");
- return result;
+ @Override
+ public Lane_Horizontal createLane_Horizontal() {
+ Lane_HorizontalImpl lane_Horizontal = new Lane_HorizontalImpl();
+ return lane_Horizontal;
}
/**
@@ -212,8 +198,10 @@ public class CrossingScenarioFactoryImpl extends EFactoryImpl implements Crossin
*
* @generated
*/
- public String convertOrientationToString(EDataType eDataType, Object instanceValue) {
- return instanceValue == null ? null : instanceValue.toString();
+ @Override
+ public Lane_Vertical createLane_Vertical() {
+ Lane_VerticalImpl lane_Vertical = new Lane_VerticalImpl();
+ return lane_Vertical;
}
/**
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioImpl.java b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioImpl.java
index ad8ee90d..5dd65a39 100644
--- a/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioImpl.java
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioImpl.java
@@ -7,6 +7,8 @@ import crossingScenario.CrossingScenario;
import crossingScenario.CrossingScenarioPackage;
import crossingScenario.Lane;
+import crossingScenario.Lane_Horizontal;
+import crossingScenario.Lane_Vertical;
import java.util.Collection;
import org.eclipse.emf.common.notify.Notification;
@@ -36,6 +38,8 @@ import org.eclipse.emf.ecore.util.InternalEList;
* {@link crossingScenario.impl.CrossingScenarioImpl#getActors Actors}
* {@link crossingScenario.impl.CrossingScenarioImpl#getLanes Lanes}
* {@link crossingScenario.impl.CrossingScenarioImpl#getMaxTime Max Time}
+ * {@link crossingScenario.impl.CrossingScenarioImpl#getHorizontal_head Horizontal head}
+ * {@link crossingScenario.impl.CrossingScenarioImpl#getVertical_head Vertical head}
*
*
* @generated
@@ -121,6 +125,26 @@ public class CrossingScenarioImpl extends MinimalEObjectImpl.Container implement
*/
protected double maxTime = MAX_TIME_EDEFAULT;
+ /**
+ * The cached value of the '{@link #getHorizontal_head() Horizontal head}' reference.
+ *
+ *
+ * @see #getHorizontal_head()
+ * @generated
+ * @ordered
+ */
+ protected Lane_Horizontal horizontal_head;
+
+ /**
+ * The cached value of the '{@link #getVertical_head() Vertical head}' reference.
+ *
+ *
+ * @see #getVertical_head()
+ * @generated
+ * @ordered
+ */
+ protected Lane_Vertical vertical_head;
+
/**
*
*
@@ -235,6 +259,86 @@ public class CrossingScenarioImpl extends MinimalEObjectImpl.Container implement
eNotify(new ENotificationImpl(this, Notification.SET, CrossingScenarioPackage.CROSSING_SCENARIO__MAX_TIME, oldMaxTime, maxTime));
}
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Lane_Horizontal getHorizontal_head() {
+ if (horizontal_head != null && horizontal_head.eIsProxy()) {
+ InternalEObject oldHorizontal_head = (InternalEObject)horizontal_head;
+ horizontal_head = (Lane_Horizontal)eResolveProxy(oldHorizontal_head);
+ if (horizontal_head != oldHorizontal_head) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, CrossingScenarioPackage.CROSSING_SCENARIO__HORIZONTAL_HEAD, oldHorizontal_head, horizontal_head));
+ }
+ }
+ return horizontal_head;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public Lane_Horizontal basicGetHorizontal_head() {
+ return horizontal_head;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void setHorizontal_head(Lane_Horizontal newHorizontal_head) {
+ Lane_Horizontal oldHorizontal_head = horizontal_head;
+ horizontal_head = newHorizontal_head;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, CrossingScenarioPackage.CROSSING_SCENARIO__HORIZONTAL_HEAD, oldHorizontal_head, horizontal_head));
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public Lane_Vertical getVertical_head() {
+ if (vertical_head != null && vertical_head.eIsProxy()) {
+ InternalEObject oldVertical_head = (InternalEObject)vertical_head;
+ vertical_head = (Lane_Vertical)eResolveProxy(oldVertical_head);
+ if (vertical_head != oldVertical_head) {
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.RESOLVE, CrossingScenarioPackage.CROSSING_SCENARIO__VERTICAL_HEAD, oldVertical_head, vertical_head));
+ }
+ }
+ return vertical_head;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ public Lane_Vertical basicGetVertical_head() {
+ return vertical_head;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public void setVertical_head(Lane_Vertical newVertical_head) {
+ Lane_Vertical oldVertical_head = vertical_head;
+ vertical_head = newVertical_head;
+ if (eNotificationRequired())
+ eNotify(new ENotificationImpl(this, Notification.SET, CrossingScenarioPackage.CROSSING_SCENARIO__VERTICAL_HEAD, oldVertical_head, vertical_head));
+ }
+
/**
*
*
@@ -269,6 +373,12 @@ public class CrossingScenarioImpl extends MinimalEObjectImpl.Container implement
return getLanes();
case CrossingScenarioPackage.CROSSING_SCENARIO__MAX_TIME:
return getMaxTime();
+ case CrossingScenarioPackage.CROSSING_SCENARIO__HORIZONTAL_HEAD:
+ if (resolve) return getHorizontal_head();
+ return basicGetHorizontal_head();
+ case CrossingScenarioPackage.CROSSING_SCENARIO__VERTICAL_HEAD:
+ if (resolve) return getVertical_head();
+ return basicGetVertical_head();
}
return super.eGet(featureID, resolve, coreType);
}
@@ -299,6 +409,12 @@ public class CrossingScenarioImpl extends MinimalEObjectImpl.Container implement
case CrossingScenarioPackage.CROSSING_SCENARIO__MAX_TIME:
setMaxTime((Double)newValue);
return;
+ case CrossingScenarioPackage.CROSSING_SCENARIO__HORIZONTAL_HEAD:
+ setHorizontal_head((Lane_Horizontal)newValue);
+ return;
+ case CrossingScenarioPackage.CROSSING_SCENARIO__VERTICAL_HEAD:
+ setVertical_head((Lane_Vertical)newValue);
+ return;
}
super.eSet(featureID, newValue);
}
@@ -326,6 +442,12 @@ public class CrossingScenarioImpl extends MinimalEObjectImpl.Container implement
case CrossingScenarioPackage.CROSSING_SCENARIO__MAX_TIME:
setMaxTime(MAX_TIME_EDEFAULT);
return;
+ case CrossingScenarioPackage.CROSSING_SCENARIO__HORIZONTAL_HEAD:
+ setHorizontal_head((Lane_Horizontal)null);
+ return;
+ case CrossingScenarioPackage.CROSSING_SCENARIO__VERTICAL_HEAD:
+ setVertical_head((Lane_Vertical)null);
+ return;
}
super.eUnset(featureID);
}
@@ -348,6 +470,10 @@ public class CrossingScenarioImpl extends MinimalEObjectImpl.Container implement
return lanes != null && !lanes.isEmpty();
case CrossingScenarioPackage.CROSSING_SCENARIO__MAX_TIME:
return maxTime != MAX_TIME_EDEFAULT;
+ case CrossingScenarioPackage.CROSSING_SCENARIO__HORIZONTAL_HEAD:
+ return horizontal_head != null;
+ case CrossingScenarioPackage.CROSSING_SCENARIO__VERTICAL_HEAD:
+ return vertical_head != null;
}
return super.eIsSet(featureID);
}
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioPackageImpl.java b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioPackageImpl.java
index 3d2ccc0d..b87d2a4d 100644
--- a/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioPackageImpl.java
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/CrossingScenarioPackageImpl.java
@@ -10,7 +10,8 @@ import crossingScenario.CrossingScenarioFactory;
import crossingScenario.CrossingScenarioPackage;
import crossingScenario.Distance;
import crossingScenario.Lane;
-import crossingScenario.Orientation;
+import crossingScenario.Lane_Horizontal;
+import crossingScenario.Lane_Vertical;
import crossingScenario.Pedestrian;
import crossingScenario.Relation;
import crossingScenario.SeparationDistance;
@@ -124,7 +125,14 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
*
* @generated
*/
- private EEnum orientationEEnum = null;
+ private EClass lane_HorizontalEClass = null;
+
+ /**
+ *
+ *
+ * @generated
+ */
+ private EClass lane_VerticalEClass = null;
/**
*
@@ -267,8 +275,8 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
* @generated
*/
@Override
- public EClass getLane() {
- return laneEClass;
+ public EReference getCrossingScenario_Horizontal_head() {
+ return (EReference)crossingScenarioEClass.getEStructuralFeatures().get(5);
}
/**
@@ -277,8 +285,18 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
* @generated
*/
@Override
- public EAttribute getLane_Orientation() {
- return (EAttribute)laneEClass.getEStructuralFeatures().get(0);
+ public EReference getCrossingScenario_Vertical_head() {
+ return (EReference)crossingScenarioEClass.getEStructuralFeatures().get(6);
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public EClass getLane() {
+ return laneEClass;
}
/**
@@ -288,7 +306,7 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
*/
@Override
public EAttribute getLane_Width() {
- return (EAttribute)laneEClass.getEStructuralFeatures().get(1);
+ return (EAttribute)laneEClass.getEStructuralFeatures().get(0);
}
/**
@@ -298,7 +316,7 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
*/
@Override
public EAttribute getLane_ReferenceCoord() {
- return (EAttribute)laneEClass.getEStructuralFeatures().get(2);
+ return (EAttribute)laneEClass.getEStructuralFeatures().get(1);
}
/**
@@ -308,7 +326,7 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
*/
@Override
public EReference getLane_PrevLane() {
- return (EReference)laneEClass.getEStructuralFeatures().get(3);
+ return (EReference)laneEClass.getEStructuralFeatures().get(2);
}
/**
@@ -318,7 +336,7 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
*/
@Override
public EReference getLane_Actors() {
- return (EReference)laneEClass.getEStructuralFeatures().get(4);
+ return (EReference)laneEClass.getEStructuralFeatures().get(3);
}
/**
@@ -328,7 +346,7 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
*/
@Override
public EAttribute getLane_NumWidth() {
- return (EAttribute)laneEClass.getEStructuralFeatures().get(5);
+ return (EAttribute)laneEClass.getEStructuralFeatures().get(4);
}
/**
@@ -557,8 +575,18 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
* @generated
*/
@Override
- public EEnum getOrientation() {
- return orientationEEnum;
+ public EClass getLane_Horizontal() {
+ return lane_HorizontalEClass;
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ public EClass getLane_Vertical() {
+ return lane_VerticalEClass;
}
/**
@@ -616,9 +644,10 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
createEReference(crossingScenarioEClass, CROSSING_SCENARIO__ACTORS);
createEReference(crossingScenarioEClass, CROSSING_SCENARIO__LANES);
createEAttribute(crossingScenarioEClass, CROSSING_SCENARIO__MAX_TIME);
+ createEReference(crossingScenarioEClass, CROSSING_SCENARIO__HORIZONTAL_HEAD);
+ createEReference(crossingScenarioEClass, CROSSING_SCENARIO__VERTICAL_HEAD);
laneEClass = createEClass(LANE);
- createEAttribute(laneEClass, LANE__ORIENTATION);
createEAttribute(laneEClass, LANE__WIDTH);
createEAttribute(laneEClass, LANE__REFERENCE_COORD);
createEReference(laneEClass, LANE__PREV_LANE);
@@ -657,8 +686,11 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
vehicleEClass = createEClass(VEHICLE);
+ lane_HorizontalEClass = createEClass(LANE_HORIZONTAL);
+
+ lane_VerticalEClass = createEClass(LANE_VERTICAL);
+
// Create enums
- orientationEEnum = createEEnum(ORIENTATION);
sizeEEnum = createEEnum(SIZE);
distanceEEnum = createEEnum(DISTANCE);
}
@@ -699,6 +731,8 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
collisionDoesNotExistEClass.getESuperTypes().add(this.getTemporalRelation());
pedestrianEClass.getESuperTypes().add(this.getActor());
vehicleEClass.getESuperTypes().add(this.getActor());
+ lane_HorizontalEClass.getESuperTypes().add(this.getLane());
+ lane_VerticalEClass.getESuperTypes().add(this.getLane());
// Initialize classes, features, and operations; add parameters
initEClass(crossingScenarioEClass, CrossingScenario.class, "CrossingScenario", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
@@ -707,9 +741,10 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
initEReference(getCrossingScenario_Actors(), this.getActor(), null, "actors", null, 0, -1, CrossingScenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getCrossingScenario_Lanes(), this.getLane(), null, "lanes", null, 0, -1, CrossingScenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, IS_COMPOSITE, !IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getCrossingScenario_MaxTime(), ecorePackage.getEDouble(), "maxTime", null, 0, 1, CrossingScenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getCrossingScenario_Horizontal_head(), this.getLane_Horizontal(), null, "horizontal_head", null, 1, 1, CrossingScenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEReference(getCrossingScenario_Vertical_head(), this.getLane_Vertical(), null, "vertical_head", null, 1, 1, CrossingScenario.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
- initEClass(laneEClass, Lane.class, "Lane", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- initEAttribute(getLane_Orientation(), this.getOrientation(), "orientation", null, 1, 1, Lane.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
+ initEClass(laneEClass, Lane.class, "Lane", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
initEAttribute(getLane_Width(), this.getSize(), "width", null, 1, 1, Lane.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEAttribute(getLane_ReferenceCoord(), ecorePackage.getEDouble(), "referenceCoord", null, 1, 1, Lane.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
initEReference(getLane_PrevLane(), this.getLane(), null, "prevLane", null, 0, 1, Lane.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED);
@@ -748,11 +783,11 @@ public class CrossingScenarioPackageImpl extends EPackageImpl implements Crossin
initEClass(vehicleEClass, Vehicle.class, "Vehicle", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
- // Initialize enums and add enum literals
- initEEnum(orientationEEnum, Orientation.class, "Orientation");
- addEEnumLiteral(orientationEEnum, Orientation.VERTICAL);
- addEEnumLiteral(orientationEEnum, Orientation.HORIZONTAL);
+ initEClass(lane_HorizontalEClass, Lane_Horizontal.class, "Lane_Horizontal", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+ initEClass(lane_VerticalEClass, Lane_Vertical.class, "Lane_Vertical", !IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS);
+
+ // Initialize enums and add enum literals
initEEnum(sizeEEnum, Size.class, "Size");
addEEnumLiteral(sizeEEnum, Size.SSMALL);
addEEnumLiteral(sizeEEnum, Size.SMED);
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/impl/LaneImpl.java b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/LaneImpl.java
index 110f26c8..c0a25d6e 100644
--- a/Domains/crossingScenario/ecore-gen/crossingScenario/impl/LaneImpl.java
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/LaneImpl.java
@@ -5,7 +5,6 @@ package crossingScenario.impl;
import crossingScenario.Actor;
import crossingScenario.CrossingScenarioPackage;
import crossingScenario.Lane;
-import crossingScenario.Orientation;
import crossingScenario.Size;
import java.util.Collection;
@@ -32,7 +31,6 @@ import org.eclipse.emf.ecore.util.InternalEList;
* The following features are implemented:
*
*
- * - {@link crossingScenario.impl.LaneImpl#getOrientation Orientation}
* - {@link crossingScenario.impl.LaneImpl#getWidth Width}
* - {@link crossingScenario.impl.LaneImpl#getReferenceCoord Reference Coord}
* - {@link crossingScenario.impl.LaneImpl#getPrevLane Prev Lane}
@@ -42,27 +40,7 @@ import org.eclipse.emf.ecore.util.InternalEList;
*
* @generated
*/
-public class LaneImpl extends MinimalEObjectImpl.Container implements Lane {
- /**
- * The default value of the '{@link #getOrientation() Orientation}' attribute.
- *
- *
- * @see #getOrientation()
- * @generated
- * @ordered
- */
- protected static final Orientation ORIENTATION_EDEFAULT = Orientation.VERTICAL;
-
- /**
- * The cached value of the '{@link #getOrientation() Orientation}' attribute.
- *
- *
- * @see #getOrientation()
- * @generated
- * @ordered
- */
- protected Orientation orientation = ORIENTATION_EDEFAULT;
-
+public abstract class LaneImpl extends MinimalEObjectImpl.Container implements Lane {
/**
* The default value of the '{@link #getWidth() Width}' attribute.
*
@@ -162,29 +140,6 @@ public class LaneImpl extends MinimalEObjectImpl.Container implements Lane {
return CrossingScenarioPackage.Literals.LANE;
}
- /**
- *
- *
- * @generated
- */
- @Override
- public Orientation getOrientation() {
- return orientation;
- }
-
- /**
- *
- *
- * @generated
- */
- @Override
- public void setOrientation(Orientation newOrientation) {
- Orientation oldOrientation = orientation;
- orientation = newOrientation == null ? ORIENTATION_EDEFAULT : newOrientation;
- if (eNotificationRequired())
- eNotify(new ENotificationImpl(this, Notification.SET, CrossingScenarioPackage.LANE__ORIENTATION, oldOrientation, orientation));
- }
-
/**
*
*
@@ -344,8 +299,6 @@ public class LaneImpl extends MinimalEObjectImpl.Container implements Lane {
@Override
public Object eGet(int featureID, boolean resolve, boolean coreType) {
switch (featureID) {
- case CrossingScenarioPackage.LANE__ORIENTATION:
- return getOrientation();
case CrossingScenarioPackage.LANE__WIDTH:
return getWidth();
case CrossingScenarioPackage.LANE__REFERENCE_COORD:
@@ -370,9 +323,6 @@ public class LaneImpl extends MinimalEObjectImpl.Container implements Lane {
@Override
public void eSet(int featureID, Object newValue) {
switch (featureID) {
- case CrossingScenarioPackage.LANE__ORIENTATION:
- setOrientation((Orientation)newValue);
- return;
case CrossingScenarioPackage.LANE__WIDTH:
setWidth((Size)newValue);
return;
@@ -401,9 +351,6 @@ public class LaneImpl extends MinimalEObjectImpl.Container implements Lane {
@Override
public void eUnset(int featureID) {
switch (featureID) {
- case CrossingScenarioPackage.LANE__ORIENTATION:
- setOrientation(ORIENTATION_EDEFAULT);
- return;
case CrossingScenarioPackage.LANE__WIDTH:
setWidth(WIDTH_EDEFAULT);
return;
@@ -431,8 +378,6 @@ public class LaneImpl extends MinimalEObjectImpl.Container implements Lane {
@Override
public boolean eIsSet(int featureID) {
switch (featureID) {
- case CrossingScenarioPackage.LANE__ORIENTATION:
- return orientation != ORIENTATION_EDEFAULT;
case CrossingScenarioPackage.LANE__WIDTH:
return width != WIDTH_EDEFAULT;
case CrossingScenarioPackage.LANE__REFERENCE_COORD:
@@ -457,9 +402,7 @@ public class LaneImpl extends MinimalEObjectImpl.Container implements Lane {
if (eIsProxy()) return super.toString();
StringBuilder result = new StringBuilder(super.toString());
- result.append(" (orientation: ");
- result.append(orientation);
- result.append(", width: ");
+ result.append(" (width: ");
result.append(width);
result.append(", referenceCoord: ");
result.append(referenceCoord);
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/impl/Lane_HorizontalImpl.java b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/Lane_HorizontalImpl.java
new file mode 100644
index 00000000..adf06602
--- /dev/null
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/Lane_HorizontalImpl.java
@@ -0,0 +1,37 @@
+/**
+ */
+package crossingScenario.impl;
+
+import crossingScenario.CrossingScenarioPackage;
+import crossingScenario.Lane_Horizontal;
+
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ *
+ * An implementation of the model object 'Lane Horizontal'.
+ *
+ *
+ * @generated
+ */
+public class Lane_HorizontalImpl extends LaneImpl implements Lane_Horizontal {
+ /**
+ *
+ *
+ * @generated
+ */
+ protected Lane_HorizontalImpl() {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return CrossingScenarioPackage.Literals.LANE_HORIZONTAL;
+ }
+
+} //Lane_HorizontalImpl
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/impl/Lane_VerticalImpl.java b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/Lane_VerticalImpl.java
new file mode 100644
index 00000000..cc1265e8
--- /dev/null
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/impl/Lane_VerticalImpl.java
@@ -0,0 +1,37 @@
+/**
+ */
+package crossingScenario.impl;
+
+import crossingScenario.CrossingScenarioPackage;
+import crossingScenario.Lane_Vertical;
+
+import org.eclipse.emf.ecore.EClass;
+
+/**
+ *
+ * An implementation of the model object 'Lane Vertical'.
+ *
+ *
+ * @generated
+ */
+public class Lane_VerticalImpl extends LaneImpl implements Lane_Vertical {
+ /**
+ *
+ *
+ * @generated
+ */
+ protected Lane_VerticalImpl() {
+ super();
+ }
+
+ /**
+ *
+ *
+ * @generated
+ */
+ @Override
+ protected EClass eStaticClass() {
+ return CrossingScenarioPackage.Literals.LANE_VERTICAL;
+ }
+
+} //Lane_VerticalImpl
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/util/CrossingScenarioAdapterFactory.java b/Domains/crossingScenario/ecore-gen/crossingScenario/util/CrossingScenarioAdapterFactory.java
index 0035a0ee..129432db 100644
--- a/Domains/crossingScenario/ecore-gen/crossingScenario/util/CrossingScenarioAdapterFactory.java
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/util/CrossingScenarioAdapterFactory.java
@@ -116,6 +116,14 @@ public class CrossingScenarioAdapterFactory extends AdapterFactoryImpl {
return createVehicleAdapter();
}
@Override
+ public Adapter caseLane_Horizontal(Lane_Horizontal object) {
+ return createLane_HorizontalAdapter();
+ }
+ @Override
+ public Adapter caseLane_Vertical(Lane_Vertical object) {
+ return createLane_VerticalAdapter();
+ }
+ @Override
public Adapter defaultCase(EObject object) {
return createEObjectAdapter();
}
@@ -303,6 +311,34 @@ public class CrossingScenarioAdapterFactory extends AdapterFactoryImpl {
return null;
}
+ /**
+ * Creates a new adapter for an object of class '{@link crossingScenario.Lane_Horizontal Lane Horizontal}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see crossingScenario.Lane_Horizontal
+ * @generated
+ */
+ public Adapter createLane_HorizontalAdapter() {
+ return null;
+ }
+
+ /**
+ * Creates a new adapter for an object of class '{@link crossingScenario.Lane_Vertical Lane Vertical}'.
+ *
+ * This default implementation returns null so that we can easily ignore cases;
+ * it's useful to ignore a case when inheritance will catch all the cases anyway.
+ *
+ * @return the new adapter.
+ * @see crossingScenario.Lane_Vertical
+ * @generated
+ */
+ public Adapter createLane_VerticalAdapter() {
+ return null;
+ }
+
/**
* Creates a new adapter for the default case.
*
diff --git a/Domains/crossingScenario/ecore-gen/crossingScenario/util/CrossingScenarioSwitch.java b/Domains/crossingScenario/ecore-gen/crossingScenario/util/CrossingScenarioSwitch.java
index b14a5c24..e07b7693 100644
--- a/Domains/crossingScenario/ecore-gen/crossingScenario/util/CrossingScenarioSwitch.java
+++ b/Domains/crossingScenario/ecore-gen/crossingScenario/util/CrossingScenarioSwitch.java
@@ -150,6 +150,20 @@ public class CrossingScenarioSwitch extends Switch {
if (result == null) result = defaultCase(theEObject);
return result;
}
+ case CrossingScenarioPackage.LANE_HORIZONTAL: {
+ Lane_Horizontal lane_Horizontal = (Lane_Horizontal)theEObject;
+ T result = caseLane_Horizontal(lane_Horizontal);
+ if (result == null) result = caseLane(lane_Horizontal);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
+ case CrossingScenarioPackage.LANE_VERTICAL: {
+ Lane_Vertical lane_Vertical = (Lane_Vertical)theEObject;
+ T result = caseLane_Vertical(lane_Vertical);
+ if (result == null) result = caseLane(lane_Vertical);
+ if (result == null) result = defaultCase(theEObject);
+ return result;
+ }
default: return defaultCase(theEObject);
}
}
@@ -334,6 +348,36 @@ public class CrossingScenarioSwitch extends Switch {
return null;
}
+ /**
+ * Returns the result of interpreting the object as an instance of 'Lane Horizontal'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Lane Horizontal'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLane_Horizontal(Lane_Horizontal object) {
+ return null;
+ }
+
+ /**
+ * Returns the result of interpreting the object as an instance of 'Lane Vertical'.
+ *
+ * This implementation returns null;
+ * returning a non-null result will terminate the switch.
+ *
+ * @param object the target of the switch.
+ * @return the result of interpreting the object as an instance of 'Lane Vertical'.
+ * @see #doSwitch(org.eclipse.emf.ecore.EObject) doSwitch(EObject)
+ * @generated
+ */
+ public T caseLane_Vertical(Lane_Vertical object) {
+ return null;
+ }
+
/**
* Returns the result of interpreting the object as an instance of 'EObject'.
*
diff --git a/Domains/crossingScenario/inputs/crossingScenarioGen.vsconfig b/Domains/crossingScenario/inputs/crossingScenarioGen.vsconfig
index 4f8267b7..b216ed3f 100644
--- a/Domains/crossingScenario/inputs/crossingScenarioGen.vsconfig
+++ b/Domains/crossingScenario/inputs/crossingScenarioGen.vsconfig
@@ -7,16 +7,17 @@ generate {
partial-model = { "inputs/CrossingScenarioInit.xmi"}
solver = ViatraSolver
scope = {
- #node = 20..30,
+ #node = 15..100,
#int = {},
- # = 1..10,
- # = 1..10,
- # = 1..10}
+ # = 20..25//,
+ //# = 1..10,
+ //# = 1..10
+ }
config = {
runtime = 10000,
log-level = normal,
- "numeric-solver" = "dreal",
+ "numeric-solver" = "z3",
"scopePropagator" = "typeHierarchy"}
runs = 1
diff --git a/Domains/crossingScenario/model/crossingScenario.aird b/Domains/crossingScenario/model/crossingScenario.aird
index 53943eaa..dbb8f664 100644
--- a/Domains/crossingScenario/model/crossingScenario.aird
+++ b/Domains/crossingScenario/model/crossingScenario.aird
@@ -5,7 +5,7 @@
crossingScenario.genmodel
-
+
@@ -82,10 +82,6 @@
-
-
-
-
@@ -102,24 +98,7 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
@@ -313,7 +292,7 @@
-
+
@@ -330,21 +309,6 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -390,6 +354,24 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -409,35 +391,35 @@
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
-
-
+
+
+
@@ -628,23 +610,15 @@
-
+
-
-
-
-
-
-
-
-
-
-
+
+
@@ -687,9 +661,73 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
+
KEEP_LOCATION
@@ -724,24 +762,17 @@
-
+
KEEP_LOCATION
KEEP_SIZE
KEEP_RATIO
-
-
+
+ italic
+
-
-
-
-
- bold
-
-
-
@@ -767,33 +798,6 @@
-
-
-
- KEEP_LOCATION
- KEEP_SIZE
- KEEP_RATIO
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
@@ -1230,6 +1234,74 @@
+
+
+
+ KEEP_LOCATION
+ KEEP_SIZE
+ KEEP_RATIO
+
+
+
+
+
+
+
+
+ KEEP_LOCATION
+ KEEP_SIZE
+ KEEP_RATIO
+
+
+
+
+
+
+
+
+
+
+
+ italic
+
+
+
+
+
+
+
+
+
+
+
+ italic
+
+
+
+
+
+
+
+
+
+
+ bold
+
+
+
+
+
+
+
+
+
+
+ bold
+
+
+
+
+
diff --git a/Domains/crossingScenario/model/crossingScenario.ecore b/Domains/crossingScenario/model/crossingScenario.ecore
index d9d97470..f651db9f 100644
--- a/Domains/crossingScenario/model/crossingScenario.ecore
+++ b/Domains/crossingScenario/model/crossingScenario.ecore
@@ -10,10 +10,12 @@
+
+
-
-
+
@@ -23,10 +25,6 @@
-
-
-
-
@@ -75,4 +73,6 @@
+
+
diff --git a/Domains/crossingScenario/model/crossingScenario.genmodel b/Domains/crossingScenario/model/crossingScenario.genmodel
index b788485b..8f1f1ddb 100644
--- a/Domains/crossingScenario/model/crossingScenario.genmodel
+++ b/Domains/crossingScenario/model/crossingScenario.genmodel
@@ -6,10 +6,6 @@
operationReflection="true" importOrganizing="true">
crossingScenario.ecore
-
-
-
-
@@ -26,9 +22,10 @@
+
+
-
@@ -62,5 +59,7 @@
+
+
diff --git a/Domains/crossingScenario/queries/crossingScenarioQueries.vql b/Domains/crossingScenario/queries/crossingScenarioQueries.vql
index 7089d0da..ee7c0b34 100644
--- a/Domains/crossingScenario/queries/crossingScenarioQueries.vql
+++ b/Domains/crossingScenario/queries/crossingScenarioQueries.vql
@@ -3,26 +3,18 @@ package queries
import "http://www.example.com/crossingScenario"
import "http://www.eclipse.org/emf/2002/Ecore"
-////Minimal Failing Example
-@Constraint(severity = "error", key = {l}, message = "this defines the placedOn relation")
-pattern patterThatOnlyWorksWithInt(l : Lane) {
- Lane.referenceCoord(l, w);
- check(w <= 0-10.0);
-}
+//////Minimal Failing Example
+//@Constraint(severity = "error", key = {l}, message = "this defines the placedOn relation")
+//pattern patterThatOnlyWorksWithInt(l : Lane) {
+// Lane.referenceCoord(l, w);
+// check(w <= 0-10.0);
+//}
//////////////
//Lane
//////////////
-/////////width, numWidth
-//@Constraint(severity="error", key={l}, message="x")
-//pattern define_numWidth_small1(l : Lane) {
-// Lane.width(l, Size::S_Small);
-// Lane.numWidth(l, nw);
-// check(nw >= 5.0);
-//}
-
-@Constraint(severity="error", key={l}, message="x")
+@Constraint(severity="error", key={l}, message="1 Lane")
pattern define_numWidth_small(l : Lane) {
Lane.width(l, Size::S_Small);
Lane.numWidth(l, nw);
@@ -33,7 +25,7 @@ pattern define_numWidth_small(l : Lane) {
check(nw >= 10.0);
}
-@Constraint(severity="error", key={l}, message="x")
+@Constraint(severity="error", key={l}, message="2 Lane")
pattern define_numWidth_medium(l : Lane) {
Lane.width(l, ::S_Med);
Lane.numWidth(l, nw);
@@ -45,7 +37,7 @@ or {
check(nw >= 15.0);
}
-@Constraint(severity="error", key={l}, message="x")
+@Constraint(severity="error", key={l}, message="3 Lane")
pattern define_numWidth_large(l : Lane) {
Lane.width(l, Size::S_Large);
Lane.numWidth(l, nw);
@@ -57,41 +49,112 @@ or {
check(nw >= 20.0);
}
-///////////referenceCoord
-//@Constraint(severity="error", key={l}, message="x")
-//pattern define_referenceCoord_horizontalAtOrigin(l:Lane) {
-// 1 == count find find_horizontalLaneAtOrigin(l);
-//}
-//
-//private pattern find_horizontalLaneAtOrigin(l:Lane){
-// Lane.orientation(l, Orientation::Horizontal);
-// Lane.referenceCoord(l, rc);
-// Lane.prevLane(l, _);
-// rc != 0.0;
-//}
-//
-//@Constraint(severity="error", key={l}, message="x")
-//pattern define_referenceCoord_verticalAtOrigin(l:Lane) {
-// 1 == count find find_verticalLaneAtOrigin(l);
-//}
-//
-//private pattern find_verticalLaneAtOrigin(l:Lane){
-// Lane.orientation(l, Orientation::Vertical);
-// Lane.referenceCoord(l, rc);
-// rc == 0.0;
-//}
-//
-//pattern define_referenceCoord_VerticalifMultipleLanes(l1:Lane, l2:Lane) {
-// //calculated risk???
-// Lane.orientation(l1, Orientation::Vertical);
-// Lane.orientation(l2, Orientation::Vertical);
-// Lane.referenceCoord(l1, rc1);
-// Lane.numWidth(l1, nw1);
-// Lane.referenceCoord(l2, rc2);
-// check(rc2 == rc1 + nw1);
-//}
-//
-//
+/////////////Prevlane
+
+////////head lanes do not have prevLane
+@Constraint(severity="error", key={l}, message="6.1 Lane")
+pattern define_prevLane_headVertLaneDoesNotHavePrevLane(cs:CrossingScenario, l:Lane_Vertical) {
+ CrossingScenario.vertical_head(cs, l);
+ Lane.prevLane(l, _);
+}
+
+@Constraint(severity="error", key={l}, message="6.2 Lane")
+pattern define_prevLane_headHoriLaneDoesNotHavePrevLane(cs:CrossingScenario, l:Lane_Horizontal) {
+ CrossingScenario.horizontal_head(cs, l);
+ Lane.prevLane(l, _);
+}
+
+////////Non-head lanes must have prevLane
+@Constraint(severity="error", key={l}, message="6.1 Lane")
+pattern define_prevLane_nonheadVertLaneHasPrevLane(l:Lane_Vertical) {
+ neg find find_headVertLane(l);
+ neg find find_laneWithPrevLane(l);
+}
+
+@Constraint(severity="error", key={l}, message="6.1 Lane")
+pattern define_prevLane_nonheadHoriLaneHasPrevLane(l:Lane_Horizontal) {
+ neg find find_headHoriLane(l);
+ neg find find_laneWithPrevLane(l);
+}
+
+private pattern find_headVertLane(l:Lane_Vertical) {
+ CrossingScenario.vertical_head(_, l);
+}
+private pattern find_headHoriLane(l:Lane_Horizontal) {
+ CrossingScenario.horizontal_head(_, l);
+}
+private pattern find_laneWithPrevLane(l:Lane) {
+ Lane.prevLane(l, _);
+}
+
+/////////Lane cannot be its own recursive prevLane
+@Constraint(severity="error", key={l}, message="6.1 Lane")
+pattern define_prevLane_lanecannotBeItsOwnPrevLane(l:Lane) {
+ Lane.prevLane(l, l);
+}
+
+@Constraint(severity="error", key={l}, message="6.2 Lane")
+pattern define_prevLane_lanecannotBeItsOwnRecursivePrevLane(l:Lane) {
+ find find_prevLane+(l, l);
+}
+private pattern find_prevLane(l1:Lane, l2:Lane) {
+ Lane.prevLane(l1, l2);
+}
+
+//////Lane cannot be prevLane of >1 other lane
+@Constraint(severity="error", key={l1, l2}, message="7 Lane")
+pattern define_prevLane_lanecannotbeprevLaneof2lanes(l1:Lane, l2:Lane) {
+ Lane.prevLane(l1, l);
+ Lane.prevLane(l2, l);
+ l1 != l2;
+}
+
+//////consecutive lanes must have same orientation
+@Constraint(severity="error", key={l1, l2}, message="8 Lane")
+pattern define_prevLane_consecutiveLanesMustHaveSameOrientation1(l1:Lane_Horizontal, l2:Lane_Vertical) {
+ Lane.prevLane(l1, l2);
+}
+
+@Constraint(severity="error", key={l1, l2}, message="8 Lane")
+pattern define_prevLane_consecutiveLanesMustHaveSameOrientation2(l1:Lane_Vertical, l2:Lane_Horizontal) {
+ Lane.prevLane(l1, l2);
+}
+
+/////////////ReferenceCoord
+
+/////refCoord of head lanes must be 0
+@Constraint(severity="error", key={l}, message="6.2 Lane")
+pattern define_prevLane_headHoriLaneHas0RefCoord(cs:CrossingScenario, l:Lane_Horizontal) {
+ CrossingScenario.horizontal_head(cs, l);
+ Lane.referenceCoord(l, rc);
+ check(rc != 0.0);
+}
+
+@Constraint(severity="error", key={l}, message="6.2 Lane")
+pattern define_prevLane_headVertLaneHas0RefCoord(cs:CrossingScenario, l:Lane_Vertical) {
+ CrossingScenario.vertical_head(cs, l);
+ Lane.referenceCoord(l, rc);
+ check(rc != 0.0);
+}
+
+//////refCoord of a lane is prevLane.rc + curLane.numWidth
+
+@Constraint(severity="error", key={l}, message="6.2 Lane")
+pattern define_referenceCoord_laneWithPrevHasCorrectRefCoord(l:Lane) {
+ Lane.prevLane(l, prev);
+ Lane.referenceCoord(l, rcCur);
+
+ Lane.numWidth(prev, wPrev);
+ Lane.referenceCoord(prev, rcPrev);
+ check(rcCur != rcPrev + wPrev);
+}
+
+
+//////////////
+//Lane+Actor
+//////////////
+
+
////@Constraint(severity = "error", key = {a}, message = "this defines the placedOn relation for vertical lanes")
////pattern actorOnVerticalLane(a : Actor) {
//// Actor.placedOn(a, l);
diff --git a/Domains/crossingScenario/src/crossingScenario/run/CrossingScenarioMain.java b/Domains/crossingScenario/src/crossingScenario/run/CrossingScenarioMain.java
index 4442fc7d..c0646edd 100644
--- a/Domains/crossingScenario/src/crossingScenario/run/CrossingScenarioMain.java
+++ b/Domains/crossingScenario/src/crossingScenario/run/CrossingScenarioMain.java
@@ -1,5 +1,7 @@
package crossingScenario.run;
+import java.awt.Desktop;
+import java.io.File;
import java.io.IOException;
import java.nio.file.Files;
import java.nio.file.Path;
@@ -33,6 +35,10 @@ public class CrossingScenarioMain {
System.out.println("postprocessing -> " + t4);
System.out.println("TOTAL -> " + tot);
-
+
+ String p1 = "outputs/models/1.xmi";
+ String p2 = "outputs/simplePrevLane.tgf";
+ QueryDebug.checkPrevLanes(p1, p2);
+ Desktop.getDesktop().open(new File(p2));
}
}
diff --git a/Domains/crossingScenario/src/crossingScenario/run/QueryDebug.java b/Domains/crossingScenario/src/crossingScenario/run/QueryDebug.java
index 2d866e85..9f9b939b 100644
--- a/Domains/crossingScenario/src/crossingScenario/run/QueryDebug.java
+++ b/Domains/crossingScenario/src/crossingScenario/run/QueryDebug.java
@@ -1,27 +1,82 @@
package crossingScenario.run;
+import java.io.FileNotFoundException;
+import java.io.PrintWriter;
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+
+import org.eclipse.emf.common.util.URI;
+import org.eclipse.emf.ecore.EPackage;
+import org.eclipse.emf.ecore.resource.Resource;
+import org.eclipse.emf.ecore.resource.ResourceSet;
+import org.eclipse.emf.ecore.resource.impl.ResourceSetImpl;
+import org.eclipse.emf.ecore.xmi.impl.XMIResourceFactoryImpl;
+
+import crossingScenario.CrossingScenario;
+import crossingScenario.CrossingScenarioPackage;
+import crossingScenario.Lane;
+
public class QueryDebug {
+ public static void main(String[] args) throws FileNotFoundException {
+// checkPrevLanes("outputs/models/1.xmi", "outputs/simplePrevLane.tgf");
+ testOnInstance();
+ }
+
+ public static void checkPrevLanes(String pathSrc, String pathTgt) throws FileNotFoundException {
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put("*", new XMIResourceFactoryImpl());
+ EPackage.Registry.INSTANCE.put(CrossingScenarioPackage.eNS_URI, CrossingScenarioPackage.eINSTANCE);
+ ResourceSet rs = new ResourceSetImpl();
+ Resource res = rs.getResource(URI.createFileURI(pathSrc), true);
+
+ PrintWriter printer = new PrintWriter(pathTgt);
+
+ CrossingScenario cs = ((CrossingScenario) res.getContents().get(0));
+ for (Lane o : cs.getLanes()) {
+ String prefix = "";
+ if (cs.getHorizontal_head().equals(o) || cs.getVertical_head().equals(o)) {
+ prefix = "HEAD";
+ }
+ String nodeName = prefix + "(" + o.getReferenceCoord() + ")" +
+ o.eClass().getName().substring(5, 9);
+ printer.println(o.hashCode() + " " + nodeName);
+ }
+ printer.println("#");
+ for (Lane o : cs.getLanes()) {
+ if (o.getPrevLane() != null){
+ int curName = o.hashCode();
+ int curPrev = o.getPrevLane().hashCode();
+ double edgeLabel = o.getPrevLane().getNumWidth();
+ printer.println(curName + " " + curPrev + " " + edgeLabel);
+ }
+ }
+ printer.flush();
+ printer.close();
+ System.out.println("TGF CREATED");
+
+ }
-// public static void main(String[] args) {
-// Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put("*", new XMIResourceFactoryImpl());
-// EPackage.Registry.INSTANCE.put(CrossingScenarioPackage.eNS_URI, CrossingScenarioPackage.eINSTANCE);
-// ResourceSet rs = new ResourceSetImpl();
-// rs.getResource(URI.createFileURI("outputs/models/1.xmi"), true);
-//
+ public static void testOnInstance() {
+ Resource.Factory.Registry.INSTANCE.getExtensionToFactoryMap( ).put("*", new XMIResourceFactoryImpl());
+ EPackage.Registry.INSTANCE.put(CrossingScenarioPackage.eNS_URI, CrossingScenarioPackage.eINSTANCE);
+ ResourceSet rs = new ResourceSetImpl();
+ rs.getResource(URI.createFileURI("outputs/models/1.xmi"), true);
+
// ViatraQueryEngine engine = ViatraQueryEngine.on(new EMFScope(rs));
// // Access pattern matcher
-//
-//
-//
// CrossingScenarioQueries.instance().prepare(engine);
-// Define_numWidth_medium.Matcher matcher = Define_numWidth_medium.Matcher.on(engine);
+//
+// Define_referenceCoord_laneWithPrevHasCorrectRefCoord.Matcher matcher = Define_referenceCoord_laneWithPrevHasCorrectRefCoord.Matcher.on(engine);
// // Get and iterate over all matches
// System.out.println("MATCHES:");
-// for (Define_numWidth_medium.Match match : matcher.getAllMatches()) {
+// for (Define_referenceCoord_laneWithPrevHasCorrectRefCoord.Match match : matcher.getAllMatches()) {
// // Print all the matches to the standard output
// System.out.println(match.getL());
// }
-// }
+ }
// public static void main(String[] args) {
@@ -84,30 +139,34 @@ public class QueryDebug {
// }
-// public static void main(String[] args) {
-// ArrayList out = new ArrayList();
-// out.add("delta-sat with delta = 0.001");
-// out.add("w1602659765 : [1.797693134862315708e+308, 1.797693134862315708e+308]");
-// String s = "1.797693134862315708e+308";
-//
-// System.out.println(parseDrealOutput(out));
-//
-// }
-//
-// private static Map parseDrealOutput(List output) {
-// Map res = new HashMap();
-// String re = "(\\w+) : \\[([0-9\\+-.e]+), ([0-9\\+-.e]+)\\]";
-//// String re = "(\\w+) : \\[(.*), (.*)\\]";
-// Pattern p = Pattern.compile(re);
-// for (String varVal : output) {
-// Matcher m = p.matcher(varVal);
-// if (m.matches()) {
-// String name = m.group(1);
-// String lowerB = m.group(2);
-// String upperB = m.group(2);
-// res.put(name, lowerB);
-// }
-// }
-// return res;
-// }
+ public static void testParsing() {
+ ArrayList out = new ArrayList();
+ out.add("delta-sat with delta = 0.001");
+ out.add("rc1601644608 : [1.797693134862315708e+308, 1.797693134862315708e+308]");
+ out.add("nw1149275723 : [12.49949999999999939, 12.50050000000000061]");
+ out.add("nw157857530 : [7.499500000000000277, 7.500499999999999723]");
+ out.add("nw1521058274 : [12.49949999999999939, 12.50050000000000061]");
+ String s = "1.797693134862315708e+308";
+
+ System.out.println(parseDrealOutput(out));
+
+ }
+
+ private static Map parseDrealOutput(List output) {
+ Map res = new HashMap();
+ String re = "(\\w+) : \\[([0-9\\+-.e]+), ([0-9\\+-.e]+)\\]";
+// String re = "(\\w+) : \\[(.*), (.*)\\]";
+ Pattern p = Pattern.compile(re);
+ for (String varVal : output) {
+ Matcher m = p.matcher(varVal);
+ if (m.matches()) {
+ String name = m.group(1);
+ String lowerB = m.group(2);
+ String upperB = m.group(2);
+ res.put(name, lowerB);
+ }
+ }
+ return res;
+ }
+
}
--
cgit v1.2.3-70-g09d2