Exemplo n.º 1
0
    def get_scenarios_by_edge(self, edge_description):

        key = self._create_edge_scenario_key(edge_description)
        scenarios = []

        for scenario_key, value in self.relationship_scenarios.items():

            check_label = key.label == scenario_key.label
            if check_label \
                    and check_subset(dict(key.source),
                                     dict(scenario_key.source)) \
                    and check_subset(dict(key.target),
                                     dict(scenario_key.target)):
                scenarios += [(e, s) for e, s in value if s.enabled]

        return scenarios
Exemplo n.º 2
0
    def get_scenarios_by_vertex(self, vertex):

        entity_key = vertex.properties

        scenarios = []
        for scenario_key, value in self.entity_scenarios.items():
            if check_subset(entity_key, dict(scenario_key)):
                scenarios += [(e, s) for e, s in value if s.enabled]
        return scenarios