From 24f172f86601ae255dbfee265155ddc433338914 Mon Sep 17 00:00:00 2001 From: Oszkar Semerath Date: Mon, 11 May 2020 02:22:52 +0200 Subject: Satelite case study update for Models-Attribute paper --- .../configs/generation.vsconfig | 4 +- .../ecore-gen/satellite/CommSubsystem.java | 46 ++ .../ecore-gen/satellite/SatellitePackage.java | 113 ++- .../satellite/impl/CommSubsystemImpl.java | 128 ++++ .../satellite/impl/SatellitePackageImpl.java | 29 + .../model/satellite.aird | 796 +++++++++++++++++++++ .../model/satellite.ecore | 68 +- .../model/satellite.genmodel | 80 ++- .../plugin.xml | 54 +- .../domains/satellite/queries/SatelliteQueries.vql | 147 ++-- .../satellite/runner/SatelliteGeneratorMain.xtend | 3 +- 11 files changed, 1327 insertions(+), 141 deletions(-) create mode 100644 Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.aird (limited to 'Domains') diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig index 2fb246c9..b95c6b68 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/configs/generation.vsconfig @@ -7,7 +7,7 @@ generate { partial-model = { "inputs/SatelliteInstance.xmi"} solver = ViatraSolver scope = { - #node += 32..64 + #node += 64..128 } config = { @@ -16,7 +16,7 @@ generate { } number = 1 - runs = 5 + runs = 3 debug = "outputs/debug" log = "outputs/log.txt" diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java index 3b9d7ecf..4c5ea937 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/CommSubsystem.java @@ -14,6 +14,8 @@ import org.eclipse.emf.ecore.EObject; *

* * * @see satellite.SatellitePackage#getCommSubsystem() @@ -44,4 +46,48 @@ public interface CommSubsystem extends EObject { */ void setTarget(CommSubsystem value); + /** + * Returns the value of the 'Frequency' attribute. + * + * + * @return the value of the 'Frequency' attribute. + * @see #setFrequency(int) + * @see satellite.SatellitePackage#getCommSubsystem_Frequency() + * @model required="true" + * @generated + */ + int getFrequency(); + + /** + * Sets the value of the '{@link satellite.CommSubsystem#getFrequency Frequency}' attribute. + * + * + * @param value the new value of the 'Frequency' attribute. + * @see #getFrequency() + * @generated + */ + void setFrequency(int value); + + /** + * Returns the value of the 'Path Length' attribute. + * + * + * @return the value of the 'Path Length' attribute. + * @see #setPathLength(int) + * @see satellite.SatellitePackage#getCommSubsystem_PathLength() + * @model required="true" + * @generated + */ + int getPathLength(); + + /** + * Sets the value of the '{@link satellite.CommSubsystem#getPathLength Path Length}' attribute. + * + * + * @param value the new value of the 'Path Length' attribute. + * @see #getPathLength() + * @generated + */ + void setPathLength(int value); + } // CommSubsystem diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java index 9ca99311..173e2388 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/SatellitePackage.java @@ -2,6 +2,7 @@ */ package satellite; +import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; @@ -286,6 +287,24 @@ public interface SatellitePackage extends EPackage { */ int COMM_SUBSYSTEM__TARGET = 0; + /** + * The feature id for the 'Frequency' attribute. + * + * + * @generated + * @ordered + */ + int COMM_SUBSYSTEM__FREQUENCY = 1; + + /** + * The feature id for the 'Path Length' attribute. + * + * + * @generated + * @ordered + */ + int COMM_SUBSYSTEM__PATH_LENGTH = 2; + /** * The number of structural features of the 'Comm Subsystem' class. * @@ -293,7 +312,7 @@ public interface SatellitePackage extends EPackage { * @generated * @ordered */ - int COMM_SUBSYSTEM_FEATURE_COUNT = 1; + int COMM_SUBSYSTEM_FEATURE_COUNT = 3; /** * The number of operations of the 'Comm Subsystem' class. @@ -563,6 +582,24 @@ public interface SatellitePackage extends EPackage { */ int UHF_COMM_SUBSYSTEM__TARGET = COMM_SUBSYSTEM__TARGET; + /** + * The feature id for the 'Frequency' attribute. + * + * + * @generated + * @ordered + */ + int UHF_COMM_SUBSYSTEM__FREQUENCY = COMM_SUBSYSTEM__FREQUENCY; + + /** + * The feature id for the 'Path Length' attribute. + * + * + * @generated + * @ordered + */ + int UHF_COMM_SUBSYSTEM__PATH_LENGTH = COMM_SUBSYSTEM__PATH_LENGTH; + /** * The number of structural features of the 'UHF Comm Subsystem' class. * @@ -600,6 +637,24 @@ public interface SatellitePackage extends EPackage { */ int XCOMM_SUBSYSTEM__TARGET = COMM_SUBSYSTEM__TARGET; + /** + * The feature id for the 'Frequency' attribute. + * + * + * @generated + * @ordered + */ + int XCOMM_SUBSYSTEM__FREQUENCY = COMM_SUBSYSTEM__FREQUENCY; + + /** + * The feature id for the 'Path Length' attribute. + * + * + * @generated + * @ordered + */ + int XCOMM_SUBSYSTEM__PATH_LENGTH = COMM_SUBSYSTEM__PATH_LENGTH; + /** * The number of structural features of the 'XComm Subsystem' class. * @@ -637,6 +692,24 @@ public interface SatellitePackage extends EPackage { */ int KA_COMM_SUBSYSTEM__TARGET = COMM_SUBSYSTEM__TARGET; + /** + * The feature id for the 'Frequency' attribute. + * + * + * @generated + * @ordered + */ + int KA_COMM_SUBSYSTEM__FREQUENCY = COMM_SUBSYSTEM__FREQUENCY; + + /** + * The feature id for the 'Path Length' attribute. + * + * + * @generated + * @ordered + */ + int KA_COMM_SUBSYSTEM__PATH_LENGTH = COMM_SUBSYSTEM__PATH_LENGTH; + /** * The number of structural features of the 'Ka Comm Subsystem' class. * @@ -770,6 +843,28 @@ public interface SatellitePackage extends EPackage { */ EReference getCommSubsystem_Target(); + /** + * Returns the meta object for the attribute '{@link satellite.CommSubsystem#getFrequency Frequency}'. + * + * + * @return the meta object for the attribute 'Frequency'. + * @see satellite.CommSubsystem#getFrequency() + * @see #getCommSubsystem() + * @generated + */ + EAttribute getCommSubsystem_Frequency(); + + /** + * Returns the meta object for the attribute '{@link satellite.CommSubsystem#getPathLength Path Length}'. + * + * + * @return the meta object for the attribute 'Path Length'. + * @see satellite.CommSubsystem#getPathLength() + * @see #getCommSubsystem() + * @generated + */ + EAttribute getCommSubsystem_PathLength(); + /** * Returns the meta object for class '{@link satellite.Payload Payload}'. * @@ -984,6 +1079,22 @@ public interface SatellitePackage extends EPackage { */ EReference COMM_SUBSYSTEM__TARGET = eINSTANCE.getCommSubsystem_Target(); + /** + * The meta object literal for the 'Frequency' attribute feature. + * + * + * @generated + */ + EAttribute COMM_SUBSYSTEM__FREQUENCY = eINSTANCE.getCommSubsystem_Frequency(); + + /** + * The meta object literal for the 'Path Length' attribute feature. + * + * + * @generated + */ + EAttribute COMM_SUBSYSTEM__PATH_LENGTH = eINSTANCE.getCommSubsystem_PathLength(); + /** * The meta object literal for the '{@link satellite.impl.PayloadImpl Payload}' class. * diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java index d39abd4d..96a25d7c 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/CommSubsystemImpl.java @@ -19,6 +19,8 @@ import satellite.SatellitePackage; *

* * * @generated @@ -34,6 +36,45 @@ public abstract class CommSubsystemImpl extends MinimalEObjectImpl.Container imp */ protected CommSubsystem target; + /** + * The default value of the '{@link #getFrequency() Frequency}' attribute. + * + * + * @see #getFrequency() + * @generated + * @ordered + */ + protected static final int FREQUENCY_EDEFAULT = 0; + /** + * The cached value of the '{@link #getFrequency() Frequency}' attribute. + * + * + * @see #getFrequency() + * @generated + * @ordered + */ + protected int frequency = FREQUENCY_EDEFAULT; + + /** + * The default value of the '{@link #getPathLength() Path Length}' attribute. + * + * + * @see #getPathLength() + * @generated + * @ordered + */ + protected static final int PATH_LENGTH_EDEFAULT = 0; + + /** + * The cached value of the '{@link #getPathLength() Path Length}' attribute. + * + * + * @see #getPathLength() + * @generated + * @ordered + */ + protected int pathLength = PATH_LENGTH_EDEFAULT; + /** * * @@ -95,6 +136,54 @@ public abstract class CommSubsystemImpl extends MinimalEObjectImpl.Container imp target)); } + /** + * + * + * @generated + */ + @Override + public int getFrequency() { + return frequency; + } + + /** + * + * + * @generated + */ + @Override + public void setFrequency(int newFrequency) { + int oldFrequency = frequency; + frequency = newFrequency; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SatellitePackage.COMM_SUBSYSTEM__FREQUENCY, + oldFrequency, frequency)); + } + + /** + * + * + * @generated + */ + @Override + public int getPathLength() { + return pathLength; + } + + /** + * + * + * @generated + */ + @Override + public void setPathLength(int newPathLength) { + int oldPathLength = pathLength; + pathLength = newPathLength; + if (eNotificationRequired()) + eNotify(new ENotificationImpl(this, Notification.SET, SatellitePackage.COMM_SUBSYSTEM__PATH_LENGTH, + oldPathLength, pathLength)); + } + /** * * @@ -107,6 +196,10 @@ public abstract class CommSubsystemImpl extends MinimalEObjectImpl.Container imp if (resolve) return getTarget(); return basicGetTarget(); + case SatellitePackage.COMM_SUBSYSTEM__FREQUENCY: + return getFrequency(); + case SatellitePackage.COMM_SUBSYSTEM__PATH_LENGTH: + return getPathLength(); } return super.eGet(featureID, resolve, coreType); } @@ -123,6 +216,12 @@ public abstract class CommSubsystemImpl extends MinimalEObjectImpl.Container imp case SatellitePackage.COMM_SUBSYSTEM__TARGET: setTarget((CommSubsystem) newValue); return; + case SatellitePackage.COMM_SUBSYSTEM__FREQUENCY: + setFrequency((Integer) newValue); + return; + case SatellitePackage.COMM_SUBSYSTEM__PATH_LENGTH: + setPathLength((Integer) newValue); + return; } super.eSet(featureID, newValue); } @@ -138,6 +237,12 @@ public abstract class CommSubsystemImpl extends MinimalEObjectImpl.Container imp case SatellitePackage.COMM_SUBSYSTEM__TARGET: setTarget((CommSubsystem) null); return; + case SatellitePackage.COMM_SUBSYSTEM__FREQUENCY: + setFrequency(FREQUENCY_EDEFAULT); + return; + case SatellitePackage.COMM_SUBSYSTEM__PATH_LENGTH: + setPathLength(PATH_LENGTH_EDEFAULT); + return; } super.eUnset(featureID); } @@ -152,8 +257,31 @@ public abstract class CommSubsystemImpl extends MinimalEObjectImpl.Container imp switch (featureID) { case SatellitePackage.COMM_SUBSYSTEM__TARGET: return target != null; + case SatellitePackage.COMM_SUBSYSTEM__FREQUENCY: + return frequency != FREQUENCY_EDEFAULT; + case SatellitePackage.COMM_SUBSYSTEM__PATH_LENGTH: + return pathLength != PATH_LENGTH_EDEFAULT; } return super.eIsSet(featureID); } + /** + * + * + * @generated + */ + @Override + public String toString() { + if (eIsProxy()) + return super.toString(); + + StringBuilder result = new StringBuilder(super.toString()); + result.append(" (frequency: "); + result.append(frequency); + result.append(", pathLength: "); + result.append(pathLength); + result.append(')'); + return result.toString(); + } + } //CommSubsystemImpl diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java index f6dc1e30..39a6075f 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/ecore-gen/satellite/impl/SatellitePackageImpl.java @@ -2,6 +2,7 @@ */ package satellite.impl; +import org.eclipse.emf.ecore.EAttribute; import org.eclipse.emf.ecore.EClass; import org.eclipse.emf.ecore.EPackage; import org.eclipse.emf.ecore.EReference; @@ -311,6 +312,26 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka return (EReference) commSubsystemEClass.getEStructuralFeatures().get(0); } + /** + * + * + * @generated + */ + @Override + public EAttribute getCommSubsystem_Frequency() { + return (EAttribute) commSubsystemEClass.getEStructuralFeatures().get(1); + } + + /** + * + * + * @generated + */ + @Override + public EAttribute getCommSubsystem_PathLength() { + return (EAttribute) commSubsystemEClass.getEStructuralFeatures().get(2); + } + /** * * @@ -447,6 +468,8 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka commSubsystemEClass = createEClass(COMM_SUBSYSTEM); createEReference(commSubsystemEClass, COMM_SUBSYSTEM__TARGET); + createEAttribute(commSubsystemEClass, COMM_SUBSYSTEM__FREQUENCY); + createEAttribute(commSubsystemEClass, COMM_SUBSYSTEM__PATH_LENGTH); payloadEClass = createEClass(PAYLOAD); @@ -541,6 +564,12 @@ public class SatellitePackageImpl extends EPackageImpl implements SatellitePacka initEReference(getCommSubsystem_Target(), this.getCommSubsystem(), null, "target", null, 0, 1, CommSubsystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_COMPOSITE, IS_RESOLVE_PROXIES, !IS_UNSETTABLE, IS_UNIQUE, !IS_DERIVED, IS_ORDERED); + initEAttribute(getCommSubsystem_Frequency(), ecorePackage.getEInt(), "frequency", null, 1, 1, + CommSubsystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); + initEAttribute(getCommSubsystem_PathLength(), ecorePackage.getEInt(), "pathLength", null, 1, 1, + CommSubsystem.class, !IS_TRANSIENT, !IS_VOLATILE, IS_CHANGEABLE, !IS_UNSETTABLE, !IS_ID, IS_UNIQUE, + !IS_DERIVED, IS_ORDERED); initEClass(payloadEClass, Payload.class, "Payload", IS_ABSTRACT, !IS_INTERFACE, IS_GENERATED_INSTANCE_CLASS); diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.aird b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.aird new file mode 100644 index 00000000..23e8b463 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.aird @@ -0,0 +1,796 @@ + + + + satellite.ecore + satellite.genmodel + + + + + + + + + + + + + + + + + + + + + + + + bold + + + + + + + + + + + + + + + + + + bold + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + italic + + + + + + + + + + + + + + + + + italic + + + + + + + + + + + + + + + + + italic + + + + + + + + + italic + + + + + + + + bold + + + + + + + + + italic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + italic + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + labelSize + bold + + + labelSize + + + + + + + + + + labelSize + bold + + + labelSize + + + + + + + + + + labelSize + bold + + + labelSize + + + + + + + + + + labelSize + + + labelSize + + + + + + + + + + + labelSize + + + labelSize + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + italic + + + + + + + + + + + + + + diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore index 9f17d43c..362df382 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.ecore @@ -1,32 +1,36 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel index bc98abd6..4d04fed0 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/model/satellite.genmodel @@ -1,39 +1,41 @@ - - - satellite.ecore - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + satellite.ecore + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml index fe1af62e..1f192d67 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/plugin.xml @@ -1,26 +1,30 @@ - - - - - - - - - - - - - - - - - - - - - +--> + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql index ba12bbda..57b5933a 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql @@ -51,13 +51,13 @@ private pattern spacecraftWithInterferometryPayload(Mission : ConstellationMissi // All spacecraft must have some communication path to the ground station -@Constraint(severity = "error", key = {Spacecraft}, - message = "Spacecraft has no communication path to the ground station.") -pattern noLinkToGroundStation(Spacecraft : Spacecraft) { - ConstellationMission.groundStationNetwork(Mission, GroundStation); - ConstellationMission.spacecraft(Mission, Spacecraft); - neg find indirectCommunicationLink(Spacecraft, GroundStation); -} +//@Constraint(severity = "error", key = {Spacecraft}, +// message = "Spacecraft has no communication path to the ground station.") +//pattern noLinkToGroundStation(Spacecraft : Spacecraft) { +// ConstellationMission.groundStationNetwork(Mission, GroundStation); +// ConstellationMission.spacecraft(Mission, Spacecraft); +// neg find indirectCommunicationLink(Spacecraft, GroundStation); +//} //@Constraint(severity = "error", key = {Spacecraft}, message = "UNSAT") //pattern unsat_linkToGroundStation(Spacecraft : Spacecraft) { @@ -66,41 +66,41 @@ pattern noLinkToGroundStation(Spacecraft : Spacecraft) { // find indirectCommunicationLink(Spacecraft, GroundStation); //} -@Constraint(severity = "error", key = {Mission}, message = "UNSAT") -pattern unsat_linkToGroundStation(Mission : InterferometryMission) { - InterferometryMission(Mission); - neg find noLinkToGroundStation(_); -} +//@Constraint(severity = "error", key = {Mission}, message = "UNSAT") +//pattern unsat_linkToGroundStation(Mission : InterferometryMission) { +// InterferometryMission(Mission); +// neg find noLinkToGroundStation(_); +//} -@Constraint(severity = "error", key = {Spacecraft}, - message = "Spacecraft has no potential communication path to the ground station.") -pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) { - ConstellationMission.groundStationNetwork(Mission, GroundStation); - ConstellationMission.spacecraft(Mission, Spacecraft); - neg find indirectLinkAllowed(Spacecraft, GroundStation); -} +//@Constraint(severity = "error", key = {Spacecraft}, +// message = "Spacecraft has no potential communication path to the ground station.") +//pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) { +// ConstellationMission.groundStationNetwork(Mission, GroundStation); +// ConstellationMission.spacecraft(Mission, Spacecraft); +// neg find indirectLinkAllowed(Spacecraft, GroundStation); +//} -private pattern indirectLinkAllowed(From : Spacecraft, To : CommunicatingElement) { - find linkAllowed+(From, To); -} +//private pattern indirectLinkAllowed(From : Spacecraft, To : CommunicatingElement) { +// find linkAllowed+(From, To); +//} -private pattern linkAllowed(From : Spacecraft, To : CommunicatingElement) { - find matchingAntenna(From, To); - neg find cubeSat3U(From); -} or { - find matchingAntenna(From, To); - CubeSat3U(From); -} or { - find matchingAntenna(From, To); - CubeSat3U(From); - GroundStationNetwork(To); -} +//private pattern linkAllowed(From : Spacecraft, To : CommunicatingElement) { +// find matchingAntenna(From, To); +// neg find cubeSat3U(From); +//} or { +// find matchingAntenna(From, To); +// CubeSat3U(From); +//} or { +// find matchingAntenna(From, To); +// CubeSat3U(From); +// GroundStationNetwork(To); +//} -private pattern matchingAntenna(From : Spacecraft, To : CommunicatingElement) { - CommunicatingElement.commSubsystem(From, FromSys); - CommunicatingElement.commSubsystem(To, ToSys); - find matchingCommSubsystem(FromSys, ToSys); -} +//private pattern matchingAntenna(From : Spacecraft, To : CommunicatingElement) { +// CommunicatingElement.commSubsystem(From, FromSys); +// CommunicatingElement.commSubsystem(To, ToSys); +// find matchingCommSubsystem(FromSys, ToSys); +//} private pattern matchingCommSubsystem(From : CommSubsystem, To : CommSubsystem) { UHFCommSubsystem(From); @@ -113,9 +113,9 @@ private pattern matchingCommSubsystem(From : CommSubsystem, To : CommSubsystem) KaCommSubsystem(To); } -private pattern cubeSat3U(Sat : CubeSat3U) { - CubeSat3U(Sat); -} +//private pattern cubeSat3U(Sat : CubeSat3U) { +// CubeSat3U(Sat); +//} // No communication loops may exist // No spacecraft may directly communicate with itself @@ -180,6 +180,71 @@ pattern smallSat(Sat : SmallSat) { SmallSat(Sat); } +@Constraint(severity = "error", key = {c1,c2}, message = "error") +pattern differentFrequency(c1 : CommSubsystem, c2 : CommSubsystem) { + CommSubsystem.target(c1,c2); + CommSubsystem.frequency(c1,f1); + CommSubsystem.frequency(c2,f2); + check(f1!=f2); +} + +@Constraint(severity = "error", key = {s,s}, message = "error") +pattern tooHighFrequencyForUHF(s : UHFCommSubsystem) { + UHFCommSubsystem(s); + CommSubsystem.frequency(s,f); + check(f>1000);//1GHz +} +@Constraint(severity = "error", key = {s,s}, message = "error") +pattern tooLowFrequencyForUHF(s : UHFCommSubsystem) { + UHFCommSubsystem(s); + CommSubsystem.frequency(s,f); + check(f<300);//300MHz +} +@Constraint(severity = "error", key = {s,s}, message = "error") +pattern tooHighFrequencyForKaComm(s : KaCommSubsystem) { + KaCommSubsystem(s); + CommSubsystem.frequency(s,f); + check(f>40000);//40GHz +} +@Constraint(severity = "error", key = {s,s}, message = "error") +pattern tooLowFrequencyForKaComm(s : KaCommSubsystem) { + KaCommSubsystem(s); + CommSubsystem.frequency(s,f); + check(f<26500);//26.5GHz +} +@Constraint(severity = "error", key = {s,s}, message = "error") +pattern tooHighFrequencyForXComm(s : XCommSubsystem) { + XCommSubsystem(s); + CommSubsystem.frequency(s,f); + check(f>12000);//12GHz +} +@Constraint(severity = "error", key = {s,s}, message = "error") +pattern tooLowFrequencyForXComm(s : XCommSubsystem) { + XCommSubsystem(s); + CommSubsystem.frequency(s,f); + check(f<8000);//8GHz +} +@Constraint(severity = "error", key = {s,s}, message = "error") +pattern tooHighPathLengthForSatelite(s:CommSubsystem) { + CommSubsystem.pathLength(s,l); + CommSubsystem.target(s,ts); + Spacecraft.commSubsystem(_,ts); + check(l>250);//250km +} +@Constraint(severity = "error", key = {s,s}, message = "error") +pattern tooLowPathLengthForSatelite(s:CommSubsystem) { + CommSubsystem.pathLength(s,l); + CommSubsystem.target(s,ts); + Spacecraft.commSubsystem(_,ts); + check(l<150);//150km +} +@Constraint(severity = "error", key = {s,s}, message = "error") +pattern tooLowPathLengthForGroundStation(s:CommSubsystem) { + CommSubsystem.pathLength(s,l); + CommSubsystem.target(s,ts); + GroundStationNetwork.commSubsystem(_,ts); + check(l!=385000);//385.000km +} //// //// Metrics //// diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.xtend index 5e4e4ef0..0ac66ce9 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.xtend +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.xtend @@ -12,6 +12,7 @@ final class SatelliteGeneratorMain { public static def void main(String[] args) { ViatraQueryEngineOptions.setSystemDefaultBackends(ReteBackendFactory.INSTANCE, ReteBackendFactory.INSTANCE, ReteBackendFactory.INSTANCE) - println(StandaloneScriptExecutor.executeScript("configs/generation.vsconfig")) + val res = StandaloneScriptExecutor.executeScript("configs/generation.vsconfig") + if(res!==null) println(res) } } -- cgit v1.2.3-54-g00ecf