diff options
author | 2019-05-06 18:42:22 -0400 | |
---|---|---|
committer | 2019-05-06 18:42:22 -0400 | |
commit | 09b1255f11ee17828da706f682e33f50316887fe (patch) | |
tree | f3783961c521b73201a9d079be78feb26e8a285c /Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql | |
parent | Merge remote-tracking branch 'origin/master' into kris (diff) | |
download | VIATRA-Generator-09b1255f11ee17828da706f682e33f50316887fe.tar.gz VIATRA-Generator-09b1255f11ee17828da706f682e33f50316887fe.tar.zst VIATRA-Generator-09b1255f11ee17828da706f682e33f50316887fe.zip |
Trying to implement spacecraft case study
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 | 64 |
1 files changed, 54 insertions, 10 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 7ca948cc..40553e29 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 | |||
@@ -13,8 +13,8 @@ pattern communicationLinkDoesNotStartAtContainingElement(Link : DirectedCommunic | |||
13 | 13 | ||
14 | // At least two spacecraft must have the interferometry payload configured | 14 | // At least two spacecraft must have the interferometry payload configured |
15 | 15 | ||
16 | //@Constraint(severity = "error", key = {Mission}, | 16 | @Constraint(severity = "error", key = {Mission}, |
17 | // message = "Interferometry mission needs at least two spacecraft configured with the interferometry payload.") | 17 | message = "Interferometry mission needs at least two spacecraft configured with the interferometry payload.") |
18 | pattern notEnoughInterferometryPayloads(Mission : InterferometryMission) { | 18 | pattern notEnoughInterferometryPayloads(Mission : InterferometryMission) { |
19 | InterferometryMission(Mission); | 19 | InterferometryMission(Mission); |
20 | neg find atLeastTwoInterferometryPayloads(Mission); | 20 | neg find atLeastTwoInterferometryPayloads(Mission); |
@@ -42,6 +42,41 @@ pattern noLinkToGroundStation(Spacecraft : Spacecraft) { | |||
42 | neg find indirectCommunicationLink(Spacecraft, GroundStation); | 42 | neg find indirectCommunicationLink(Spacecraft, GroundStation); |
43 | } | 43 | } |
44 | 44 | ||
45 | @Constraint(severity = "error", key = {Spacecraft}, | ||
46 | message = "Spacecraft has no potential communication path to the ground station.") | ||
47 | pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) { | ||
48 | ConstellationMission.groundStationNetwork(Mission, GroundStation); | ||
49 | ConstellationMission.spacecraft(Mission, Spacecraft); | ||
50 | neg find indirectLinkAllowed(Spacecraft, GroundStation); | ||
51 | } | ||
52 | |||
53 | private pattern indirectLinkAllowed(From : Spacecraft, To : CommunicatingElement) { | ||
54 | find linkAllowed+(From, To); | ||
55 | } | ||
56 | |||
57 | private pattern linkAllowed(From : Spacecraft, To : CommunicatingElement) { | ||
58 | find matchingAntenna(From, To, _); | ||
59 | neg find cubeSat3U(From); | ||
60 | } or { | ||
61 | find matchingAntenna(From, To, TransceiverBand::UHF); | ||
62 | CubeSat3U(From); | ||
63 | } or { | ||
64 | find matchingAntenna(From, To, _); | ||
65 | CubeSat3U(From); | ||
66 | GroundStationNetwork(To); | ||
67 | } | ||
68 | |||
69 | private pattern matchingAntenna(From : Spacecraft, To : CommunicatingElement, Band : TransceiverBand) { | ||
70 | CommunicatingElement.commSubsystem.band(From, Band); | ||
71 | CommunicatingElement.commSubsystem.band(To, Band); | ||
72 | CommunicatingElement.commSubsystem.gain(From, Gain); | ||
73 | CommunicatingElement.commSubsystem.gain(To, Gain); | ||
74 | } | ||
75 | |||
76 | private pattern cubeSat3U(Sat : CubeSat3U) { | ||
77 | CubeSat3U(Sat); | ||
78 | } | ||
79 | |||
45 | // No communication loops may exist | 80 | // No communication loops may exist |
46 | // No spacecraft may directly communicate with itself | 81 | // No spacecraft may directly communicate with itself |
47 | 82 | ||
@@ -133,8 +168,7 @@ pattern kaAntennaGainLow(Comm : CommSubsystem) { | |||
133 | 168 | ||
134 | @Constraint(severity = "error", key = {Sat}, | 169 | @Constraint(severity = "error", key = {Sat}, |
135 | message = "3U CubeSats can only cross-link using UHF.") | 170 | message = "3U CubeSats can only cross-link using UHF.") |
136 | pattern threeUCubeSatWithNonUhfCrossLink(Sat : Spacecraft) { | 171 | pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { |
137 | Spacecraft.kind(Sat, SpacecraftKind::CubeSat3U); | ||
138 | CommunicatingElement.commSubsystem(Sat, SourceComm); | 172 | CommunicatingElement.commSubsystem(Sat, SourceComm); |
139 | neg find commSubsystemBandUhf(SourceComm); | 173 | neg find commSubsystemBandUhf(SourceComm); |
140 | DirectedCommunicationLink.source(Link, SourceComm); | 174 | DirectedCommunicationLink.source(Link, SourceComm); |
@@ -160,10 +194,23 @@ pattern cubeSatWithKaAntenna(Spacecraft : Spacecraft) { | |||
160 | neg find smallSat(Spacecraft); | 194 | neg find smallSat(Spacecraft); |
161 | } | 195 | } |
162 | 196 | ||
163 | private pattern smallSat(Sat : Spacecraft) { | 197 | pattern smallSat(Sat : SmallSat) { |
164 | Spacecraft.kind(Sat, SpacecraftKind::SmallSat); | 198 | SmallSat(Sat); |
165 | } | 199 | } |
166 | 200 | ||
201 | @QueryBasedFeature(feature = "kind") | ||
202 | pattern spacecraftOfKind(Spacecraft : Spacecraft, Kind : SpacecraftKind) { | ||
203 | CubeSat3U(Spacecraft); | ||
204 | Kind == SpacecraftKind::CubeSat3U; | ||
205 | } or { | ||
206 | CubeSat6U(Spacecraft); | ||
207 | Kind == SpacecraftKind::CubeSat6U; | ||
208 | } or { | ||
209 | SmallSat(Spacecraft); | ||
210 | Kind == SpacecraftKind::SmallSat; | ||
211 | } | ||
212 | |||
213 | /* | ||
167 | // | 214 | // |
168 | // Metrics | 215 | // Metrics |
169 | // | 216 | // |
@@ -262,10 +309,6 @@ private pattern spacecraftCost(Mission : InterferometryMission, Spacecraft : Spa | |||
262 | Cost == eval(BasePrice * Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost); | 309 | Cost == eval(BasePrice * Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost); |
263 | } | 310 | } |
264 | 311 | ||
265 | private pattern spacecraftOfKind(Spacecraft : Spacecraft, Kind : SpacecraftKind) { | ||
266 | Spacecraft.kind(Spacecraft, Kind); | ||
267 | } | ||
268 | |||
269 | private pattern basePrice(Spacecraft : Spacecraft, BasePrice : java Double) { | 312 | private pattern basePrice(Spacecraft : Spacecraft, BasePrice : java Double) { |
270 | Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat3U); | 313 | Spacecraft.kind(Spacecraft, SpacecraftKind::CubeSat3U); |
271 | BasePrice == 250000.0; | 314 | BasePrice == 250000.0; |
@@ -298,3 +341,4 @@ private pattern spacecraftWithTwoCommSubsystems(Spacecraft : Spacecraft) { | |||
298 | Spacecraft.commSubsystem(Spacecraft, Subsystem2); | 341 | Spacecraft.commSubsystem(Spacecraft, Subsystem2); |
299 | Subsystem1 != Subsystem2; | 342 | Subsystem1 != Subsystem2; |
300 | } | 343 | } |
344 | */ \ No newline at end of file | ||