From 110268c8e8937df8d67075caebd6d31460d0f81a Mon Sep 17 00:00:00 2001 From: Kristóf Marussy Date: Thu, 15 Aug 2019 15:36:05 +0200 Subject: Measurements WIP --- .../mit/inf/dslreasoner/run/SatelliteHint.xtend | 37 ---------------------- 1 file changed, 37 deletions(-) (limited to 'Tests/hu.bme.mit.inf.dslreasoner.run/src/hu/bme/mit/inf/dslreasoner/run/SatelliteHint.xtend') diff --git a/Tests/hu.bme.mit.inf.dslreasoner.run/src/hu/bme/mit/inf/dslreasoner/run/SatelliteHint.xtend b/Tests/hu.bme.mit.inf.dslreasoner.run/src/hu/bme/mit/inf/dslreasoner/run/SatelliteHint.xtend index e95c0c64..ef5b779e 100644 --- a/Tests/hu.bme.mit.inf.dslreasoner.run/src/hu/bme/mit/inf/dslreasoner/run/SatelliteHint.xtend +++ b/Tests/hu.bme.mit.inf.dslreasoner.run/src/hu/bme/mit/inf/dslreasoner/run/SatelliteHint.xtend @@ -9,8 +9,6 @@ import hu.bme.mit.inf.dslreasoner.viatrasolver.logic2viatra.patterns.PatternGene class SatelliteHint extends Ecore2LogicTraceBasedHint { static val INTERFEROMETY_PAYLOAD = "hint_interferometryPayload" static val REMAINING_CONTENTS_KA_COMM_SUBSYSTEM = "hint_kaCommSubsystem" - static val HINT_SPACECRAFT_UHF_POSSIBLE_LINK = "hint_spacecraftWithUhfPossibleLink" - static val HINT_SPACECRAFT_UHF_ONLY_NO_LINK = "hint_spacecraftUhfOnlyNoLink" new(Ecore2Logic ecore2Logic, Ecore2Logic_Trace trace) { super(ecore2Logic, trace) @@ -32,54 +30,19 @@ class SatelliteHint extends Ecore2LogicTraceBasedHint { find interpretation(problem, interpretation); remainingContents == sum find «REMAINING_CONTENTS_KA_COMM_SUBSYSTEM»_helper(problem, interpretation, _, #_); } - - private pattern hint_spacecraftNotUhfOnly(problem:LogicProblem, interpretation:PartialInterpretation, spacecraft:DefinedElement) { - find interpretation(problem, interpretation); - find mustExist(problem, interpretation, spacecraft); - «typeIndexer.referInstanceOf("Spacecraft".type, Modality.MUST, "spacecraft")» - «relationDeclarationIndexer.referRelation("CommunicatingElement".relation("commSubsystem"), "spacecraft", "comm", Modality.MAY)» - neg «typeIndexer.referInstanceOf("UHFCommSubsystem".type, Modality.MUST, "comm")» - } - - private pattern hint_spacecraftWithUhf(problem:LogicProblem, interpretation:PartialInterpretation, spacecraft:DefinedElement) { - find interpretation(problem, interpretation); - find mustExist(problem, interpretation, spacecraft); - «typeIndexer.referInstanceOf("Spacecraft".type, Modality.MUST, "spacecraft")» - «relationDeclarationIndexer.referRelation("CommunicatingElement".relation("commSubsystem"), "spacecraft", "comm", Modality.MUST)» - «typeIndexer.referInstanceOf("UHFCommSubsystem".type, Modality.MUST, "comm")» - } - - pattern «HINT_SPACECRAFT_UHF_POSSIBLE_LINK»(problem:LogicProblem, interpretation:PartialInterpretation) { - find hint_spacecraftWithUhf(problem, interpretation, spacecraft); - find hint_spacecraftNotUhfOnly(problem, interpretation, spacecraft); - } - - pattern «HINT_SPACECRAFT_UHF_ONLY_NO_LINK»(problem:LogicProblem, interpretation:PartialInterpretation) { - find interpretation(problem, interpretation); - find mustExist(problem, interpretation, spacecraft); - «typeIndexer.referInstanceOf("Spacecraft".type, Modality.MUST, "spacecraft")» - neg find hint_spacecraftNotUhfOnly(problem, interpretation, spacecraft); - find currentInRelation_pattern_hu_bme_mit_inf_dslreasoner_domains_satellite_queries_noLinkToGroundStation(problem, interpretation, spacecraft); - } ''' override createConstraintUpdater(LinearTypeExpressionBuilderFactory it) { val interferometryPayloadCount = createBuilder.add(1, "InterferometryPayload".type).build val kaCommSubsystemWithoutSmallSatCount = createBuilder.add(1, "KaCommSubsystem".type).add(-2, "SmallSat".type). build - val uhfCommSubsystemCount = createBuilder.add(1, "UHFCommSubsystem".type).build val interferometryPayloadMatcher = createMatcher(INTERFEROMETY_PAYLOAD) val kaCommSubsystemRemainingContentsMatcher = createMatcher(REMAINING_CONTENTS_KA_COMM_SUBSYSTEM) - val uhfPossibleLinkMatcher = createMatcher(HINT_SPACECRAFT_UHF_POSSIBLE_LINK) - val uhfNoLinkMatcher = createMatcher(HINT_SPACECRAFT_UHF_ONLY_NO_LINK) return [ p | interferometryPayloadCount.tightenLowerBound(2 - interferometryPayloadMatcher.countMatches(p)) kaCommSubsystemWithoutSmallSatCount.tightenUpperBound(kaCommSubsystemRemainingContentsMatcher.getCount(p)) - if (uhfPossibleLinkMatcher.countMatches(p) == 0 && uhfNoLinkMatcher.countMatches(p) >= 1) { - uhfCommSubsystemCount.tightenLowerBound(1) - } ] } -- cgit v1.2.3-54-g00ecf