diff options
author | 2020-05-11 02:22:52 +0200 | |
---|---|---|
committer | 2020-05-11 02:22:52 +0200 | |
commit | 24f172f86601ae255dbfee265155ddc433338914 (patch) | |
tree | 123fbc0872701b7fd9f8f50cee32cf0f28db9eaf /Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src | |
parent | separated must and current UP rules to support non-prop neg finds (diff) | |
download | VIATRA-Generator-24f172f86601ae255dbfee265155ddc433338914.tar.gz VIATRA-Generator-24f172f86601ae255dbfee265155ddc433338914.tar.zst VIATRA-Generator-24f172f86601ae255dbfee265155ddc433338914.zip |
Satelite case study update for Models-Attribute paper
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src')
2 files changed, 108 insertions, 42 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 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 | |||
51 | 51 | ||
52 | // All spacecraft must have some communication path to the ground station | 52 | // All spacecraft must have some communication path to the ground station |
53 | 53 | ||
54 | @Constraint(severity = "error", key = {Spacecraft}, | 54 | //@Constraint(severity = "error", key = {Spacecraft}, |
55 | message = "Spacecraft has no communication path to the ground station.") | 55 | // message = "Spacecraft has no communication path to the ground station.") |
56 | pattern noLinkToGroundStation(Spacecraft : Spacecraft) { | 56 | //pattern noLinkToGroundStation(Spacecraft : Spacecraft) { |
57 | ConstellationMission.groundStationNetwork(Mission, GroundStation); | 57 | // ConstellationMission.groundStationNetwork(Mission, GroundStation); |
58 | ConstellationMission.spacecraft(Mission, Spacecraft); | 58 | // ConstellationMission.spacecraft(Mission, Spacecraft); |
59 | neg find indirectCommunicationLink(Spacecraft, GroundStation); | 59 | // neg find indirectCommunicationLink(Spacecraft, GroundStation); |
60 | } | 60 | //} |
61 | 61 | ||
62 | //@Constraint(severity = "error", key = {Spacecraft}, message = "UNSAT") | 62 | //@Constraint(severity = "error", key = {Spacecraft}, message = "UNSAT") |
63 | //pattern unsat_linkToGroundStation(Spacecraft : Spacecraft) { | 63 | //pattern unsat_linkToGroundStation(Spacecraft : Spacecraft) { |
@@ -66,41 +66,41 @@ pattern noLinkToGroundStation(Spacecraft : Spacecraft) { | |||
66 | // find indirectCommunicationLink(Spacecraft, GroundStation); | 66 | // find indirectCommunicationLink(Spacecraft, GroundStation); |
67 | //} | 67 | //} |
68 | 68 | ||
69 | @Constraint(severity = "error", key = {Mission}, message = "UNSAT") | 69 | //@Constraint(severity = "error", key = {Mission}, message = "UNSAT") |
70 | pattern unsat_linkToGroundStation(Mission : InterferometryMission) { | 70 | //pattern unsat_linkToGroundStation(Mission : InterferometryMission) { |
71 | InterferometryMission(Mission); | 71 | // InterferometryMission(Mission); |
72 | neg find noLinkToGroundStation(_); | 72 | // neg find noLinkToGroundStation(_); |
73 | } | 73 | //} |
74 | 74 | ||
75 | @Constraint(severity = "error", key = {Spacecraft}, | 75 | //@Constraint(severity = "error", key = {Spacecraft}, |
76 | message = "Spacecraft has no potential communication path to the ground station.") | 76 | // message = "Spacecraft has no potential communication path to the ground station.") |
77 | pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) { | 77 | //pattern noPotentialLinkToGroundStation(Spacecraft : Spacecraft) { |
78 | ConstellationMission.groundStationNetwork(Mission, GroundStation); | 78 | // ConstellationMission.groundStationNetwork(Mission, GroundStation); |
79 | ConstellationMission.spacecraft(Mission, Spacecraft); | 79 | // ConstellationMission.spacecraft(Mission, Spacecraft); |
80 | neg find indirectLinkAllowed(Spacecraft, GroundStation); | 80 | // neg find indirectLinkAllowed(Spacecraft, GroundStation); |
81 | } | 81 | //} |
82 | 82 | ||
83 | private pattern indirectLinkAllowed(From : Spacecraft, To : CommunicatingElement) { | 83 | //private pattern indirectLinkAllowed(From : Spacecraft, To : CommunicatingElement) { |
84 | find linkAllowed+(From, To); | 84 | // find linkAllowed+(From, To); |
85 | } | 85 | //} |
86 | 86 | ||
87 | private pattern linkAllowed(From : Spacecraft, To : CommunicatingElement) { | 87 | //private pattern linkAllowed(From : Spacecraft, To : CommunicatingElement) { |
88 | find matchingAntenna(From, To); | 88 | // find matchingAntenna(From, To); |
89 | neg find cubeSat3U(From); | 89 | // neg find cubeSat3U(From); |
90 | } or { | 90 | //} or { |
91 | find matchingAntenna(From, To); | 91 | // find matchingAntenna(From, To); |
92 | CubeSat3U(From); | 92 | // CubeSat3U(From); |
93 | } or { | 93 | //} or { |
94 | find matchingAntenna(From, To); | 94 | // find matchingAntenna(From, To); |
95 | CubeSat3U(From); | 95 | // CubeSat3U(From); |
96 | GroundStationNetwork(To); | 96 | // GroundStationNetwork(To); |
97 | } | 97 | //} |
98 | 98 | ||
99 | private pattern matchingAntenna(From : Spacecraft, To : CommunicatingElement) { | 99 | //private pattern matchingAntenna(From : Spacecraft, To : CommunicatingElement) { |
100 | CommunicatingElement.commSubsystem(From, FromSys); | 100 | // CommunicatingElement.commSubsystem(From, FromSys); |
101 | CommunicatingElement.commSubsystem(To, ToSys); | 101 | // CommunicatingElement.commSubsystem(To, ToSys); |
102 | find matchingCommSubsystem(FromSys, ToSys); | 102 | // find matchingCommSubsystem(FromSys, ToSys); |
103 | } | 103 | //} |
104 | 104 | ||
105 | private pattern matchingCommSubsystem(From : CommSubsystem, To : CommSubsystem) { | 105 | private pattern matchingCommSubsystem(From : CommSubsystem, To : CommSubsystem) { |
106 | UHFCommSubsystem(From); | 106 | UHFCommSubsystem(From); |
@@ -113,9 +113,9 @@ private pattern matchingCommSubsystem(From : CommSubsystem, To : CommSubsystem) | |||
113 | KaCommSubsystem(To); | 113 | KaCommSubsystem(To); |
114 | } | 114 | } |
115 | 115 | ||
116 | private pattern cubeSat3U(Sat : CubeSat3U) { | 116 | //private pattern cubeSat3U(Sat : CubeSat3U) { |
117 | CubeSat3U(Sat); | 117 | // CubeSat3U(Sat); |
118 | } | 118 | //} |
119 | 119 | ||
120 | // No communication loops may exist | 120 | // No communication loops may exist |
121 | // No spacecraft may directly communicate with itself | 121 | // No spacecraft may directly communicate with itself |
@@ -180,6 +180,71 @@ pattern smallSat(Sat : SmallSat) { | |||
180 | SmallSat(Sat); | 180 | SmallSat(Sat); |
181 | } | 181 | } |
182 | 182 | ||
183 | @Constraint(severity = "error", key = {c1,c2}, message = "error") | ||
184 | pattern differentFrequency(c1 : CommSubsystem, c2 : CommSubsystem) { | ||
185 | CommSubsystem.target(c1,c2); | ||
186 | CommSubsystem.frequency(c1,f1); | ||
187 | CommSubsystem.frequency(c2,f2); | ||
188 | check(f1!=f2); | ||
189 | } | ||
190 | |||
191 | @Constraint(severity = "error", key = {s,s}, message = "error") | ||
192 | pattern tooHighFrequencyForUHF(s : UHFCommSubsystem) { | ||
193 | UHFCommSubsystem(s); | ||
194 | CommSubsystem.frequency(s,f); | ||
195 | check(f>1000);//1GHz | ||
196 | } | ||
197 | @Constraint(severity = "error", key = {s,s}, message = "error") | ||
198 | pattern tooLowFrequencyForUHF(s : UHFCommSubsystem) { | ||
199 | UHFCommSubsystem(s); | ||
200 | CommSubsystem.frequency(s,f); | ||
201 | check(f<300);//300MHz | ||
202 | } | ||
203 | @Constraint(severity = "error", key = {s,s}, message = "error") | ||
204 | pattern tooHighFrequencyForKaComm(s : KaCommSubsystem) { | ||
205 | KaCommSubsystem(s); | ||
206 | CommSubsystem.frequency(s,f); | ||
207 | check(f>40000);//40GHz | ||
208 | } | ||
209 | @Constraint(severity = "error", key = {s,s}, message = "error") | ||
210 | pattern tooLowFrequencyForKaComm(s : KaCommSubsystem) { | ||
211 | KaCommSubsystem(s); | ||
212 | CommSubsystem.frequency(s,f); | ||
213 | check(f<26500);//26.5GHz | ||
214 | } | ||
215 | @Constraint(severity = "error", key = {s,s}, message = "error") | ||
216 | pattern tooHighFrequencyForXComm(s : XCommSubsystem) { | ||
217 | XCommSubsystem(s); | ||
218 | CommSubsystem.frequency(s,f); | ||
219 | check(f>12000);//12GHz | ||
220 | } | ||
221 | @Constraint(severity = "error", key = {s,s}, message = "error") | ||
222 | pattern tooLowFrequencyForXComm(s : XCommSubsystem) { | ||
223 | XCommSubsystem(s); | ||
224 | CommSubsystem.frequency(s,f); | ||
225 | check(f<8000);//8GHz | ||
226 | } | ||
227 | @Constraint(severity = "error", key = {s,s}, message = "error") | ||
228 | pattern tooHighPathLengthForSatelite(s:CommSubsystem) { | ||
229 | CommSubsystem.pathLength(s,l); | ||
230 | CommSubsystem.target(s,ts); | ||
231 | Spacecraft.commSubsystem(_,ts); | ||
232 | check(l>250);//250km | ||
233 | } | ||
234 | @Constraint(severity = "error", key = {s,s}, message = "error") | ||
235 | pattern tooLowPathLengthForSatelite(s:CommSubsystem) { | ||
236 | CommSubsystem.pathLength(s,l); | ||
237 | CommSubsystem.target(s,ts); | ||
238 | Spacecraft.commSubsystem(_,ts); | ||
239 | check(l<150);//150km | ||
240 | } | ||
241 | @Constraint(severity = "error", key = {s,s}, message = "error") | ||
242 | pattern tooLowPathLengthForGroundStation(s:CommSubsystem) { | ||
243 | CommSubsystem.pathLength(s,l); | ||
244 | CommSubsystem.target(s,ts); | ||
245 | GroundStationNetwork.commSubsystem(_,ts); | ||
246 | check(l!=385000);//385.000km | ||
247 | } | ||
183 | //// | 248 | //// |
184 | //// Metrics | 249 | //// Metrics |
185 | //// | 250 | //// |
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 { | |||
12 | public static def void main(String[] args) { | 12 | public static def void main(String[] args) { |
13 | ViatraQueryEngineOptions.setSystemDefaultBackends(ReteBackendFactory.INSTANCE, ReteBackendFactory.INSTANCE, | 13 | ViatraQueryEngineOptions.setSystemDefaultBackends(ReteBackendFactory.INSTANCE, ReteBackendFactory.INSTANCE, |
14 | ReteBackendFactory.INSTANCE) | 14 | ReteBackendFactory.INSTANCE) |
15 | println(StandaloneScriptExecutor.executeScript("configs/generation.vsconfig")) | 15 | val res = StandaloneScriptExecutor.executeScript("configs/generation.vsconfig") |
16 | if(res!==null) println(res) | ||
16 | } | 17 | } |
17 | } | 18 | } |