Skip to content
Snippets Groups Projects
Commit c916163f authored by Johannes Mey's avatar Johannes Mey
Browse files

add and update ecore, xcore, and relast resources

parent 3abd9f42
No related branches found
No related tags found
No related merge requests found
......@@ -58,10 +58,10 @@
<eClassifiers xsi:type="ecore:EClass" name="SwitchPosition" eSuperTypes="#//RailwayElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="position" unique="false"
eType="#//Position"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="route" eType="#//Route"
<eStructuralFeatures xsi:type="ecore:EReference" name="route" lowerBound="1" eType="#//Route"
eOpposite="#//Route/follows"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="target" eType="#//Switch"
eOpposite="#//Switch/positions"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="target" lowerBound="1"
eType="#//Switch" eOpposite="#//Switch/positions"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Semaphore" eSuperTypes="#//RailwayElement">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="signal" unique="false"
......
@Ecore(nsURI="http://www.semanticweb.org/ontologies/2015/trainbenchmark")
@GenModel(bundleManifest="false",
modelDirectory="trainbenchmark-format-emf-model/build/xcore/main",
complianceLevel="8.0")
package hu.bme.mit.trainbenchmark.railway
abstract class RailwayElement {
int ^id
}
class RailwayContainer {
contains Route[] routes
contains Region[] regions
}
class Region extends RailwayElement {
contains Sensor[] sensors
contains TrackElement[] elements
}
class Route extends RailwayElement {
boolean active
contains SwitchPosition[] follows opposite route
refers Sensor[2..*] requires
refers Semaphore entry
refers Semaphore exit
}
class Sensor extends RailwayElement {
refers TrackElement[] monitors opposite monitoredBy
}
abstract class TrackElement extends RailwayElement {
refers Sensor[] monitoredBy opposite monitors
refers TrackElement[] connectsTo
}
class Segment extends TrackElement {
int length
contains Semaphore[] semaphores
}
class Switch extends TrackElement {
Position currentPosition
refers SwitchPosition[] positions opposite target
}
class SwitchPosition extends RailwayElement {
Position position
refers Route route opposite follows
refers Switch target opposite positions
}
class Semaphore extends RailwayElement {
Signal signal
}
enum Position {
FAILURE = 0
STRAIGHT = 1
DIVERGING = 2
}
enum Signal {
FAILURE = 0
STOP = 1
GO = 2
}
<?xml version="1.0" encoding="UTF-8"?>
<ecore:EPackage xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns:ecore="http://www.eclipse.org/emf/2002/Ecore"
xmi:version="2.0" name="statemachine"
nsURI="http://www.example.org/statemachine" nsPrefix="statemachine">
<eClassifiers xsi:type="ecore:EClass" name="StateMachine">
<eStructuralFeatures xsi:type="ecore:EReference" name="element" upperBound="-1" eType="#//Element"
containment="true"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="initial" lowerBound="1" eType="#//State"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="final" upperBound="-1" eType="#//State"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Element" abstract="true">
<eStructuralFeatures xsi:type="ecore:EAttribute" name="label"
eType="ecore:EDataType http://www.eclipse.org/emf/2002/Ecore#//EString"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="State" eSuperTypes="#//Element">
<eStructuralFeatures xsi:type="ecore:EReference" name="outgoing" upperBound="-1"
eType="#//Transition" eOpposite="#//Transition/from"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="incoming" upperBound="-1" eType="#//Transition"
eOpposite="#//Transition/to"/>
</eClassifiers>
<eClassifiers xsi:type="ecore:EClass" name="Transition" eSuperTypes="#//Element">
<eStructuralFeatures xsi:type="ecore:EReference" name="from" lowerBound="1" eType="#//State"
eOpposite="#//State/outgoing"/>
<eStructuralFeatures xsi:type="ecore:EReference" name="to" lowerBound="1" eType="#//State"
eOpposite="#//State/incoming"/>
</eClassifiers>
</ecore:EPackage>
RailwayContainer ::= Route* Region*;
abstract RailwayElement ::= <Id:int>;
Region : RailwayElement ::= TrackElement* Sensor*;
Semaphore : RailwayElement ::= <Signal:Signal>;
Route : RailwayElement ::= <Active:boolean> SwitchPosition*;
SwitchPosition : RailwayElement ::= <Position:Position>;
Sensor : RailwayElement;
abstract TrackElement : RailwayElement;
Segment : TrackElement ::= <Length:int> Semaphore*;
Switch : TrackElement ::= <CurrentPosition:Position>;
rel Route.requires* <-> Sensor.requiredBy*;
rel Route.entry? -> Semaphore;
rel Route.exit? -> Semaphore;
rel Sensor.monitors* <-> TrackElement.monitoredBy*;
rel TrackElement.connectsTo* -> TrackElement;
rel SwitchPosition.target <-> Switch.positions*;
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment