diff options
author | 2019-06-09 14:45:02 -0400 | |
---|---|---|
committer | 2019-06-09 14:45:02 -0400 | |
commit | 555987a459702674da350fa1fd5f76ffe14cd7c0 (patch) | |
tree | c64f2af9d655eb94b1a13d8c22f67bbf34435e0f /Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql | |
parent | Trying to simplify Satellite case study (diff) | |
download | VIATRA-Generator-555987a459702674da350fa1fd5f76ffe14cd7c0.tar.gz VIATRA-Generator-555987a459702674da350fa1fd5f76ffe14cd7c0.tar.zst VIATRA-Generator-555987a459702674da350fa1fd5f76ffe14cd7c0.zip |
Simplify satellite metamodel further
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql')
-rw-r--r-- | Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql | 31 |
1 files changed, 16 insertions, 15 deletions
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 557c1172..bdda6ec7 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 | |||
@@ -2,13 +2,17 @@ package hu.bme.mit.inf.dslreasoner.domains.satellite.queries | |||
2 | 2 | ||
3 | import "http://www.example.org/satellite" | 3 | import "http://www.example.org/satellite" |
4 | 4 | ||
5 | @Constraint(severity = "error", key = {Link}, | 5 | @Constraint(severity = "error", key = {Element}, |
6 | message = "Communication links must start from the containing element.") | 6 | message = "A communicating element may not have two transmitting communication subsystems..") |
7 | pattern communicationLinkDoesNotStartAtContainingElement(Link : DirectedCommunicationLink) { | 7 | pattern communicationLinkDoesNotStartAtContainingElement(Element : CommunicatingElement) { |
8 | CommunicatingElement.communicationLink(Element, Link); | 8 | find transmittingCommSubsystem(Element, Comm1); |
9 | DirectedCommunicationLink.source(Link, SourceComm); | 9 | find transmittingCommSubsystem(Element, Comm2); |
10 | CommunicatingElement.commSubsystem(SourceElement, SourceComm); | 10 | Comm1 != Comm2; |
11 | Element != SourceElement; | 11 | } |
12 | |||
13 | private pattern transmittingCommSubsystem(Element : CommunicatingElement, Comm : CommSubsystem) { | ||
14 | CommunicatingElement.commSubsystem(Element, Comm); | ||
15 | CommSubsystem.target(Comm, _); | ||
12 | } | 16 | } |
13 | 17 | ||
14 | // At least two spacecraft must have the interferometry payload configured | 18 | // At least two spacecraft must have the interferometry payload configured |
@@ -105,19 +109,17 @@ private pattern indirectCommunicationLink(Source : CommunicatingElement, Target | |||
105 | } | 109 | } |
106 | 110 | ||
107 | private pattern directCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { | 111 | private pattern directCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { |
108 | DirectedCommunicationLink.source(Link, SourceSubsystem); | 112 | CommSubsystem.target(SourceSubsystem, TargetSubsystem); |
109 | DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
110 | CommunicatingElement.commSubsystem(Source, SourceSubsystem); | 113 | CommunicatingElement.commSubsystem(Source, SourceSubsystem); |
111 | CommunicatingElement.commSubsystem(Target, TargetSubsystem); | 114 | CommunicatingElement.commSubsystem(Target, TargetSubsystem); |
112 | } | 115 | } |
113 | 116 | ||
114 | // Source and target communication systems must be compatible. | 117 | // Source and target communication systems must be compatible. |
115 | 118 | ||
116 | @Constraint(severity = "error", key = {Link}, | 119 | @Constraint(severity = "error", key = {SourceSubsystem}, |
117 | message = "Two ends of a communication link must use the same band.") | 120 | message = "Two ends of a communication link must use the same band.") |
118 | pattern incompatibleSourceAndTargetBand(Link : DirectedCommunicationLink) { | 121 | pattern incompatibleSourceAndTargetBand(SourceSubsystem : CommSubsystem) { |
119 | DirectedCommunicationLink.source(Link, SourceSubsystem); | 122 | CommSubsystem.target(SourceSubsystem, TargetSubsystem); |
120 | DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
121 | neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); | 123 | neg find matchingCommSubsystem(SourceSubsystem, TargetSubsystem); |
122 | } | 124 | } |
123 | 125 | ||
@@ -129,8 +131,7 @@ pattern incompatibleSourceAndTargetBand(Link : DirectedCommunicationLink) { | |||
129 | pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { | 131 | pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { |
130 | CommunicatingElement.commSubsystem(Sat, SourceComm); | 132 | CommunicatingElement.commSubsystem(Sat, SourceComm); |
131 | neg find commSubsystemBandUhf(SourceComm); | 133 | neg find commSubsystemBandUhf(SourceComm); |
132 | DirectedCommunicationLink.source(Link, SourceComm); | 134 | CommSubsystem.target(SourceComm, TargetComm); |
133 | DirectedCommunicationLink.target(Link, TargetComm); | ||
134 | CommunicatingElement.commSubsystem(Target, TargetComm); | 135 | CommunicatingElement.commSubsystem(Target, TargetComm); |
135 | neg find groundStationNetwork(Target); | 136 | neg find groundStationNetwork(Target); |
136 | } | 137 | } |