diff options
author | 2019-06-15 20:56:47 -0400 | |
---|---|---|
committer | 2019-06-15 20:56:47 -0400 | |
commit | c0c5a1644cc221352b8b9b370eea6a87677ba948 (patch) | |
tree | 4b1412577c568440b7098dc31691438ebc8e7e9d /Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner | |
parent | Bump MDEOptimizer version (diff) | |
download | VIATRA-Generator-c0c5a1644cc221352b8b9b370eea6a87677ba948.tar.gz VIATRA-Generator-c0c5a1644cc221352b8b9b370eea6a87677ba948.tar.zst VIATRA-Generator-c0c5a1644cc221352b8b9b370eea6a87677ba948.zip |
Try fix statecode bug
Modified graph width calculation to not depend on order of nodes
Diffstat (limited to 'Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner')
2 files changed, 152 insertions, 152 deletions
diff --git a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/mdeo/CostObjective.xtend b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/mdeo/CostObjective.xtend index 3a8688e9..43b2902f 100644 --- a/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/mdeo/CostObjective.xtend +++ b/Domains/hu.bme.mit.inf.dslreasoner.domains.satellite/src/hu/bme/mit/inf/dslreasoner/domains/satellite/mdeo/CostObjective.xtend | |||
@@ -1,13 +1,13 @@ | |||
1 | package hu.bme.mit.inf.dslreasoner.domains.satellite.mdeo | 1 | package hu.bme.mit.inf.dslreasoner.domains.satellite.mdeo |
2 | 2 | ||
3 | import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric | 3 | //import hu.bme.mit.inf.dslreasoner.domains.satellite.queries.CostMetric |
4 | 4 | // | |
5 | class CostObjective extends MetricBasedGuidanceFunction { | 5 | //class CostObjective extends MetricBasedGuidanceFunction { |
6 | new() { | 6 | // new() { |
7 | super(CostMetric.instance) | 7 | // super(CostMetric.instance) |
8 | } | 8 | // } |
9 | 9 | // | |
10 | override getName() { | 10 | // override getName() { |
11 | "Cost" | 11 | // "Cost" |
12 | } | 12 | // } |
13 | } | 13 | //} |
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 711c7ce6..c7135562 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 | |||
@@ -158,146 +158,146 @@ pattern smallSat(Sat : SmallSat) { | |||
158 | SmallSat(Sat); | 158 | SmallSat(Sat); |
159 | } | 159 | } |
160 | 160 | ||
161 | //// | ||
162 | //// Metrics | ||
163 | //// | ||
161 | // | 164 | // |
162 | // Metrics | 165 | //// Coverage |
163 | // | 166 | // |
164 | 167 | //pattern coverageMetric(Coverage : java Double) { | |
165 | // Coverage | 168 | // Coverage == sum find missionCoverage(_, #_); |
166 | 169 | //} | |
167 | pattern coverageMetric(Coverage : java Double) { | 170 | // |
168 | Coverage == sum find missionCoverage(_, #_); | 171 | //private pattern missionCoverage(Mission : InterferometryMission, Coverage : java Double) { |
169 | } | 172 | // InterferometryMission.observationTime(Mission, ObservationTime); |
170 | 173 | // ObserverCount == count find spacecraftWithInterferometryPayload(Mission, _); | |
171 | private pattern missionCoverage(Mission : InterferometryMission, Coverage : java Double) { | 174 | // Coverage == eval(Math.pow(1 - 2.0 / ObserverCount, 1 + 9 * (1.0 / ObservationTime)) + 0.05 * ObservationTime / 3); |
172 | InterferometryMission.observationTime(Mission, ObservationTime); | 175 | //} |
173 | ObserverCount == count find spacecraftWithInterferometryPayload(Mission, _); | 176 | // |
174 | Coverage == eval(Math.pow(1 - 2.0 / ObserverCount, 1 + 9 * (1.0 / ObservationTime)) + 0.05 * ObservationTime / 3); | 177 | //// Time |
175 | } | 178 | // |
176 | 179 | //pattern timeMetric(Time : java Double) { | |
177 | // Time | 180 | // Time == sum find missionTime(_, #_); |
178 | 181 | //} | |
179 | pattern timeMetric(Time : java Double) { | 182 | // |
180 | Time == sum find missionTime(_, #_); | 183 | //private pattern missionTime(Mission : InterferometryMission, Time : java Double) { |
181 | } | 184 | // InterferometryMission.observationTime(Mission, ObservationTime); |
182 | 185 | // TrasmitTime == sum find transmitTime(Mission, _, #_); | |
183 | private pattern missionTime(Mission : InterferometryMission, Time : java Double) { | 186 | // Time == eval(TrasmitTime + 60.0 * ObservationTime); |
184 | InterferometryMission.observationTime(Mission, ObservationTime); | 187 | //} |
185 | TrasmitTime == sum find transmitTime(Mission, _, #_); | 188 | // |
186 | Time == eval(TrasmitTime + 60.0 * ObservationTime); | 189 | //private pattern transmitTime(Mission : InterferometryMission, Spacecraft : Spacecraft, TransmitTime : java Double) { |
187 | } | 190 | // ConstellationMission.spacecraft(Mission, Spacecraft); |
188 | 191 | // find scienceData(Spacecraft, ScienceData); | |
189 | private pattern transmitTime(Mission : InterferometryMission, Spacecraft : Spacecraft, TransmitTime : java Double) { | 192 | // IncomingData == sum find incomingData(Spacecraft, _, #_); |
190 | ConstellationMission.spacecraft(Mission, Spacecraft); | 193 | // find transmitRate(Spacecraft, TransmitRate); |
191 | find scienceData(Spacecraft, ScienceData); | 194 | // TransmitTime == eval((ScienceData + IncomingData) / (7.5 * TransmitRate)); |
192 | IncomingData == sum find incomingData(Spacecraft, _, #_); | 195 | //} |
193 | find transmitRate(Spacecraft, TransmitRate); | 196 | // |
194 | TransmitTime == eval((ScienceData + IncomingData) / (7.5 * TransmitRate)); | 197 | //private pattern incomingData(Spacecraft : Spacecraft, Source : Spacecraft, Data : java Double) { |
195 | } | 198 | // find indirectCommunicationLink(Source, Spacecraft); |
196 | 199 | // find scienceData(Source, Data); | |
197 | private pattern incomingData(Spacecraft : Spacecraft, Source : Spacecraft, Data : java Double) { | 200 | //} |
198 | find indirectCommunicationLink(Source, Spacecraft); | 201 | // |
199 | find scienceData(Source, Data); | 202 | //private pattern scienceData(Spacecraft : Spacecraft, Data : java Double) { |
200 | } | 203 | // ConstellationMission.spacecraft(Mission, Spacecraft); |
201 | 204 | // InterferometryMission.observationTime(Mission, ObservationTime); | |
202 | private pattern scienceData(Spacecraft : Spacecraft, Data : java Double) { | 205 | // Data == eval(12.0 * ObservationTime); |
203 | ConstellationMission.spacecraft(Mission, Spacecraft); | 206 | //} |
204 | InterferometryMission.observationTime(Mission, ObservationTime); | 207 | // |
205 | Data == eval(12.0 * ObservationTime); | 208 | //private pattern transmitRate(Spacecraft : Spacecraft, TransmitRate : java Double) { |
206 | } | 209 | // find spacecraftUplink(Spacecraft, Comm, Target); |
207 | 210 | // UHFCommSubsystem(Comm); | |
208 | private pattern transmitRate(Spacecraft : Spacecraft, TransmitRate : java Double) { | 211 | // Spacecraft(Target); |
209 | find spacecraftUplink(Spacecraft, Comm, Target); | 212 | // TransmitRate == 5.0; |
210 | UHFCommSubsystem(Comm); | 213 | //} or { |
211 | Spacecraft(Target); | 214 | // find spacecraftUplink(Spacecraft, Comm, Target); |
212 | TransmitRate == 5.0; | 215 | // XCommSubsystem(Comm); |
213 | } or { | 216 | // Spacecraft(Target); |
214 | find spacecraftUplink(Spacecraft, Comm, Target); | 217 | // TransmitRate == 1.6; |
215 | XCommSubsystem(Comm); | 218 | //} or { |
216 | Spacecraft(Target); | 219 | // find spacecraftUplink(Spacecraft, Comm, Target); |
217 | TransmitRate == 1.6; | 220 | // XCommSubsystem(Comm); |
218 | } or { | 221 | // GroundStationNetwork(Target); |
219 | find spacecraftUplink(Spacecraft, Comm, Target); | 222 | // TransmitRate == 0.7; |
220 | XCommSubsystem(Comm); | 223 | //} or { |
221 | GroundStationNetwork(Target); | 224 | // find spacecraftUplink(Spacecraft, Comm, Target); |
222 | TransmitRate == 0.7; | 225 | // KaCommSubsystem(Comm); |
223 | } or { | 226 | // Spacecraft(Target); |
224 | find spacecraftUplink(Spacecraft, Comm, Target); | 227 | // TransmitRate == 220.0; |
225 | KaCommSubsystem(Comm); | 228 | //} or { |
226 | Spacecraft(Target); | 229 | // find spacecraftUplink(Spacecraft, Comm, Target); |
227 | TransmitRate == 220.0; | 230 | // KaCommSubsystem(Comm); |
228 | } or { | 231 | // GroundStationNetwork(Target); |
229 | find spacecraftUplink(Spacecraft, Comm, Target); | 232 | // TransmitRate == 80.0; |
230 | KaCommSubsystem(Comm); | 233 | //} |
231 | GroundStationNetwork(Target); | 234 | // |
232 | TransmitRate == 80.0; | 235 | //private pattern spacecraftUplink(Spacecraft : Spacecraft, TargetSubsystem : CommSubsystem, Target : CommunicatingElement) { |
233 | } | 236 | // CommunicatingElement.commSubsystem.target(Spacecraft, TargetSubsystem); |
234 | 237 | // CommunicatingElement.commSubsystem(Target, TargetSubsystem); | |
235 | private pattern spacecraftUplink(Spacecraft : Spacecraft, TargetSubsystem : CommSubsystem, Target : CommunicatingElement) { | 238 | //} |
236 | CommunicatingElement.commSubsystem.target(Spacecraft, TargetSubsystem); | 239 | // |
237 | CommunicatingElement.commSubsystem(Target, TargetSubsystem); | 240 | //// Cost |
238 | } | 241 | // |
239 | 242 | //pattern costMetric(Cost : java Double) { | |
240 | // Cost | 243 | // Cost == sum find missionCost(_, #_); |
241 | 244 | //} | |
242 | pattern costMetric(Cost : java Double) { | 245 | // |
243 | Cost == sum find missionCost(_, #_); | 246 | //private pattern missionCost(Mission : InterferometryMission, Cost : java Double) { |
244 | } | 247 | // InterferometryMission.observationTime(Mission, ObservationTime); |
245 | 248 | // SpacecraftCost == sum find spacecraftCost(Mission, _, #_); | |
246 | private pattern missionCost(Mission : InterferometryMission, Cost : java Double) { | 249 | // Cost == eval(SpacecraftCost + 100000.0 * ObservationTime); |
247 | InterferometryMission.observationTime(Mission, ObservationTime); | 250 | //} |
248 | SpacecraftCost == sum find spacecraftCost(Mission, _, #_); | 251 | // |
249 | Cost == eval(SpacecraftCost + 100000.0 * ObservationTime); | 252 | //private pattern spacecraftCost(Mission : InterferometryMission, Spacecraft : Spacecraft, Cost : java Double) { |
250 | } | 253 | // ConstellationMission.spacecraft(Mission, Spacecraft); |
251 | 254 | // find spacecraftOfKindCount(Spacecraft, KindCount); | |
252 | private pattern spacecraftCost(Mission : InterferometryMission, Spacecraft : Spacecraft, Cost : java Double) { | 255 | // find basePrice(Spacecraft, BasePrice); |
253 | ConstellationMission.spacecraft(Mission, Spacecraft); | 256 | // find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost); |
254 | find spacecraftOfKindCount(Spacecraft, KindCount); | 257 | // find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost); |
255 | find basePrice(Spacecraft, BasePrice); | 258 | // Cost == eval(BasePrice * Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost); |
256 | find interferometryPayloadCost(Spacecraft, InterferometryPayloadCost); | 259 | //} |
257 | find additionalCommSubsystemCost(Spacecraft, AdditionalCommSubsystemCost); | 260 | // |
258 | Cost == eval(BasePrice * Math.pow(KindCount, -0.25) + InterferometryPayloadCost + AdditionalCommSubsystemCost); | 261 | //private pattern spacecraftOfKindCount(Sat : Spacecraft, Count : java Integer) { |
259 | } | 262 | // CubeSat3U(Sat); |
260 | 263 | // Count == count find cubeSat3U(_); | |
261 | private pattern spacecraftOfKindCount(Sat : Spacecraft, Count : java Integer) { | 264 | //} or { |
262 | CubeSat3U(Sat); | 265 | // CubeSat6U(Sat); |
263 | Count == count find cubeSat3U(_); | 266 | // Count == count find cubeSat6U(_); |
264 | } or { | 267 | //} or { |
265 | CubeSat6U(Sat); | 268 | // SmallSat(Sat); |
266 | Count == count find cubeSat6U(_); | 269 | // Count == count find smallSat(_); |
267 | } or { | 270 | //} |
268 | SmallSat(Sat); | 271 | // |
269 | Count == count find smallSat(_); | 272 | //private pattern basePrice(Spacecraft : Spacecraft, BasePrice : java Double) { |
270 | } | 273 | // CubeSat3U(Spacecraft); |
271 | 274 | // BasePrice == 250000.0; | |
272 | private pattern basePrice(Spacecraft : Spacecraft, BasePrice : java Double) { | 275 | //} or { |
273 | CubeSat3U(Spacecraft); | 276 | // CubeSat6U(Spacecraft); |
274 | BasePrice == 250000.0; | 277 | // BasePrice == 750000.0; |
275 | } or { | 278 | //} or { |
276 | CubeSat6U(Spacecraft); | 279 | // SmallSat(Spacecraft); |
277 | BasePrice == 750000.0; | 280 | // BasePrice == 3000000.0; |
278 | } or { | 281 | //} |
279 | SmallSat(Spacecraft); | 282 | // |
280 | BasePrice == 3000000.0; | 283 | //private pattern interferometryPayloadCost(Spacecraft : Spacecraft, Cost : java Double) { |
281 | } | 284 | // find spacecraftWithInterferometryPayload(_, Spacecraft); |
282 | 285 | // Cost == 50000.0; | |
283 | private pattern interferometryPayloadCost(Spacecraft : Spacecraft, Cost : java Double) { | 286 | //} or { |
284 | find spacecraftWithInterferometryPayload(_, Spacecraft); | 287 | // neg find spacecraftWithInterferometryPayload(_, Spacecraft); |
285 | Cost == 50000.0; | 288 | // Cost == 0.0; |
286 | } or { | 289 | //} |
287 | neg find spacecraftWithInterferometryPayload(_, Spacecraft); | 290 | // |
288 | Cost == 0.0; | 291 | //private pattern additionalCommSubsystemCost(Spacecraft : Spacecraft, Cost : java Double) { |
289 | } | 292 | // find spacecraftWithTwoCommSubsystems(Spacecraft); |
290 | 293 | // Cost == 100000.0; | |
291 | private pattern additionalCommSubsystemCost(Spacecraft : Spacecraft, Cost : java Double) { | 294 | //} or { |
292 | find spacecraftWithTwoCommSubsystems(Spacecraft); | 295 | // neg find spacecraftWithTwoCommSubsystems(Spacecraft); |
293 | Cost == 100000.0; | 296 | // Cost == 0.0; |
294 | } or { | 297 | //} |
295 | neg find spacecraftWithTwoCommSubsystems(Spacecraft); | 298 | // |
296 | Cost == 0.0; | 299 | //private pattern spacecraftWithTwoCommSubsystems(Spacecraft : Spacecraft) { |
297 | } | 300 | // Spacecraft.commSubsystem(Spacecraft, Subsystem1); |
298 | 301 | // Spacecraft.commSubsystem(Spacecraft, Subsystem2); | |
299 | private pattern spacecraftWithTwoCommSubsystems(Spacecraft : Spacecraft) { | 302 | // Subsystem1 != Subsystem2; |
300 | Spacecraft.commSubsystem(Spacecraft, Subsystem1); | 303 | //} |
301 | Spacecraft.commSubsystem(Spacecraft, Subsystem2); | ||
302 | Subsystem1 != Subsystem2; | ||
303 | } | ||