diff options
author | 2019-04-15 16:23:19 +0200 | |
---|---|---|
committer | 2019-04-15 16:23:19 +0200 | |
commit | 2531cfb60d747c261a20201415728beb0e24ab9b (patch) | |
tree | 0d7a242c674d735879e8c017bda7212e7ad02df2 /Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains | |
parent | Make diversity checking work with optimization (diff) | |
download | VIATRA-Generator-2531cfb60d747c261a20201415728beb0e24ab9b.tar.gz VIATRA-Generator-2531cfb60d747c261a20201415728beb0e24ab9b.tar.zst VIATRA-Generator-2531cfb60d747c261a20201415728beb0e24ab9b.zip |
Satellite constellation case study WIP
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains')
2 files changed, 177 insertions, 0 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 new file mode 100644 index 00000000..d0542b4a --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/queries/SatelliteQueries.vql | |||
@@ -0,0 +1,164 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.satellite.queries | ||
2 | |||
3 | import "http://www.example.org/satellite" | ||
4 | |||
5 | @Constraint(severity = "error", key = {Link}, | ||
6 | message = "Communication links must start from the containing element.") | ||
7 | pattern communicationLinkDoesNotStartAtContainingElement(Link : DirectedCommunicationLink) { | ||
8 | CommunicatingElement.communicationLink(Element, Link); | ||
9 | DirectedCommunicationLink.source(Link, SourceComm); | ||
10 | CommunicatingElement.commSubsystem(SourceElement, SourceComm); | ||
11 | Element != SourceElement; | ||
12 | } | ||
13 | |||
14 | // At least two spacecraft must have the interferometry payload configured | ||
15 | |||
16 | //@Constraint(severity = "error", key = {Mission}, | ||
17 | // message = "Interferometry mission needs at least two spacecraft configured with the interferometry payload.") | ||
18 | pattern notEnoughInterferometryPayloads(Mission : InterferometryMission) { | ||
19 | InterferometryMission(Mission); | ||
20 | neg find atLeastTwoInterferometryPayloads(Mission); | ||
21 | } | ||
22 | |||
23 | private pattern atLeastTwoInterferometryPayloads(Mission : InterferometryMission) { | ||
24 | find spacecraftWithInterferometryPayload(Mission, Spacecraft1); | ||
25 | find spacecraftWithInterferometryPayload(Mission, Spacecraft2); | ||
26 | Spacecraft1 != Spacecraft2; | ||
27 | } | ||
28 | |||
29 | private pattern spacecraftWithInterferometryPayload(Mission : ConstellationMission, Spacecraft : Spacecraft) { | ||
30 | ConstellationMission.spacecraft(Mission, Spacecraft); | ||
31 | Spacecraft.payload(Spacecraft, Payload); | ||
32 | InterferometryPayload(Payload); | ||
33 | } | ||
34 | |||
35 | // All spacecraft must have some communication path to the ground station | ||
36 | |||
37 | @Constraint(severity = "error", key = {Spacecraft}, | ||
38 | message = "Spacecraft has no communication path to the ground station.") | ||
39 | pattern noLinkToGroundStation(Spacecraft : Spacecraft) { | ||
40 | ConstellationMission.groundStationNetwork(Mission, GroundStation); | ||
41 | ConstellationMission.spacecraft(Mission, Spacecraft); | ||
42 | neg find indirectCommunicationLink(Spacecraft, GroundStation); | ||
43 | } | ||
44 | |||
45 | // No communication loops may exist | ||
46 | // No spacecraft may directly communicate with itself | ||
47 | |||
48 | @Constraint(severity = "error", key = {Element}, | ||
49 | message = "Communication loop.") | ||
50 | pattern communicationLoop(Element : CommunicatingElement) { | ||
51 | find indirectCommunicationLink(Element, Element); | ||
52 | } | ||
53 | |||
54 | private pattern indirectCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { | ||
55 | find directCommunicationLink+(Source, Target); | ||
56 | } | ||
57 | |||
58 | private pattern directCommunicationLink(Source : CommunicatingElement, Target : CommunicatingElement) { | ||
59 | DirectedCommunicationLink.source(Link, SourceSubsystem); | ||
60 | DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
61 | CommunicatingElement.commSubsystem(Source, SourceSubsystem); | ||
62 | CommunicatingElement.commSubsystem(Target, TargetSubsystem); | ||
63 | } | ||
64 | |||
65 | // Source and target communication systems must be compatible. | ||
66 | |||
67 | @Constraint(severity = "error", key = {Link}, | ||
68 | message = "Two ends of a communication link must use the same band.") | ||
69 | pattern incompatibleSourceAndTargetBand(Link : DirectedCommunicationLink) { | ||
70 | DirectedCommunicationLink.source(Link, SourceSubsystem); | ||
71 | DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
72 | CommSubsystem.band(SourceSubsystem, Band); | ||
73 | neg find commSubsystemBand(TargetSubsystem, Band); | ||
74 | } | ||
75 | |||
76 | private pattern commSubsystemBand(Comm : CommSubsystem, Band : TransceiverBand) { | ||
77 | CommSubsystem.band(Comm, Band); | ||
78 | } | ||
79 | |||
80 | @Constraint(severity = "error", key = {Link}, | ||
81 | message = "Two ends of a communication link must use the same antenna gain.") | ||
82 | pattern incompatibleSourceAndTargetGain(Link : DirectedCommunicationLink) { | ||
83 | DirectedCommunicationLink.source(Link, SourceSubsystem); | ||
84 | DirectedCommunicationLink.target(Link, TargetSubsystem); | ||
85 | CommSubsystem.gain(SourceSubsystem, Gain); | ||
86 | neg find commSubsystemGain(TargetSubsystem, Gain); | ||
87 | } | ||
88 | |||
89 | private pattern commSubsystemGain(Comm : CommSubsystem, Gain : AntennaGain) { | ||
90 | CommSubsystem.gain(Comm, Gain); | ||
91 | } | ||
92 | |||
93 | // UHF-band transmitters may only be combined with a low gain antenna | ||
94 | |||
95 | @Constraint(severity = "error", key = {Comm}, | ||
96 | message = "UHF transceiver must be combined with a low gain antenna.") | ||
97 | pattern uhfAntennaGainNotLow(Comm : CommSubsystem) { | ||
98 | CommSubsystem.band(Comm, TransceiverBand::UHF); | ||
99 | // VIATRA will fail to infer a type constraint for the virtual variable introduced | ||
100 | // when an enum literal appears in a negative pattern call, so we use a helper pattern | ||
101 | // instead of neg find commSubsystemGain(Comm, AntennaGain::LOW); | ||
102 | neg find commSubsystemGainLow(Comm); | ||
103 | } | ||
104 | |||
105 | private pattern commSubsystemGainLow(Comm : CommSubsystem) { | ||
106 | CommSubsystem.gain(Comm, AntennaGain::LOW); | ||
107 | } | ||
108 | |||
109 | // X-band transmitters may only be combined with a medium gain antenna | ||
110 | |||
111 | @Constraint(severity = "error", key = {Comm}, | ||
112 | message = "X-band transceiver must be combined with a medium gain antenna.") | ||
113 | pattern xAntennaGainNotMedium(Comm : CommSubsystem) { | ||
114 | CommSubsystem.band(Comm, TransceiverBand::X); | ||
115 | neg find commSubsystemGainMedium(Comm); | ||
116 | } | ||
117 | |||
118 | private pattern commSubsystemGainMedium(Comm : CommSubsystem) { | ||
119 | CommSubsystem.gain(Comm, AntennaGain::MEDIUM); | ||
120 | } | ||
121 | |||
122 | // Ka-band transmitters may only be combined with a medium or high gain antenna | ||
123 | |||
124 | @Constraint(severity = "error", key = {Comm}, | ||
125 | message = "Ka-band transceiver must be combined with a medium or high gain antenna.") | ||
126 | pattern kaAntennaGainLow(Comm : CommSubsystem) { | ||
127 | CommSubsystem.band(Comm, TransceiverBand::Ka); | ||
128 | CommSubsystem.gain(Comm, AntennaGain::LOW); | ||
129 | } | ||
130 | |||
131 | // 3U CubeSats are assumed to only be able to downlink to Earth using an X-band trasmitter, | ||
132 | // but cross-link using UHF | ||
133 | |||
134 | @Constraint(severity = "error", key = {Sat}, | ||
135 | message = "3U CubeSats can only cross-link using UHF.") | ||
136 | pattern threeUCubeSatWithNonUhfCrossLink(Sat : CubeSat3U) { | ||
137 | CommunicatingElement.commSubsystem(Sat, SourceComm); | ||
138 | neg find commSubsystemBandUhf(SourceComm); | ||
139 | DirectedCommunicationLink.source(Link, SourceComm); | ||
140 | DirectedCommunicationLink.target(Link, TargetComm); | ||
141 | CommunicatingElement.commSubsystem(Target, TargetComm); | ||
142 | neg find groundStationNetwork(Target); | ||
143 | } | ||
144 | |||
145 | private pattern commSubsystemBandUhf(Comm : CommSubsystem) { | ||
146 | CommSubsystem.band(Comm, TransceiverBand::UHF); | ||
147 | } | ||
148 | |||
149 | private pattern groundStationNetwork(Network : GroundStationNetwork) { | ||
150 | GroundStationNetwork(Network); | ||
151 | } | ||
152 | |||
153 | // Only a Small Satellite can be configured with a Ka-band communication system | ||
154 | |||
155 | @Constraint(severity = "error", key = {Spacecraft}, | ||
156 | message = "Only a Small Satellite can be configured with a Ka-band communication system.") | ||
157 | pattern cubeSatWithKaAntenna(Spacecraft : Spacecraft) { | ||
158 | CommunicatingElement.commSubsystem.band(Spacecraft, TransceiverBand::Ka); | ||
159 | neg find smallSat(Spacecraft); | ||
160 | } | ||
161 | |||
162 | private pattern smallSat(Sat : SmallSat) { | ||
163 | SmallSat(Sat); | ||
164 | } | ||
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 new file mode 100644 index 00000000..592348e8 --- /dev/null +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/runner/SatelliteGeneratorMain.xtend | |||
@@ -0,0 +1,13 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.satellite.runner | ||
2 | |||
3 | import hu.bme.mit.inf.dslreasoner.application.execution.StandaloneScriptExecutor | ||
4 | |||
5 | final class SatelliteGeneratorMain { | ||
6 | private new() { | ||
7 | throw new IllegalStateException("This is a static utility class and should not be instantiated directly.") | ||
8 | } | ||
9 | |||
10 | static def void main(String[] args) { | ||
11 | println(StandaloneScriptExecutor.executeScript("configs/generation.vsconfig")) | ||
12 | } | ||
13 | } | ||