public void addPossiblesEventsComplex ( ) { Set < Scenario > scenarios = this . getScenarios ( ) ; for ( Scenario s : scenarios ) { for ( Class < ? extends Event > c : s . getPossibleEventsOfNE ( ) . keySet ( ) ) { if ( ! this . getPossibleEventsOfNE ( ) . containsKey ( c ) ) { this . addPossibleEventsOfNE ( c , s . getPossibleEventsOfNE ( ) . get ( c ) ) ; } else { List < Set < NetworkElement >> elements = this . getPossibleEventsOfNE ( ) . get ( c ) ; // elements.addAll(s.getPossibleEventsOfNE().get(c)); for ( Set < NetworkElement > sne : s . getPossibleEventsOfNE ( ) . get ( c ) ) { if ( ! elements . contains ( sne ) ) elements . add ( sne ) ; } this . addPossibleEventsOfNE ( c , elements ) ; } } for ( Class < ? extends Event > c : s . getPossibleEventsOfScenario ( ) . keySet ( ) ) { if ( ! this . getPossibleEventsOfScenario ( ) . containsKey ( c ) ) { this . addPossibleEventsOfScenario ( c , s . getPossibleEventsOfScenario ( ) . get ( c ) ) ; } else { List < Set < Scenario >> elements = this . getPossibleEventsOfScenario ( ) . get ( c ) ; // elements.addAll(s.getPossibleEventsOfScenario().get(c)); for ( Set < Scenario > sne : s . getPossibleEventsOfScenario ( ) . get ( c ) ) { if ( ! elements . contains ( sne ) ) elements . add ( sne ) ; } this . addPossibleEventsOfScenario ( c , elements ) ; } } } }
J Anadido eventos de escenario y evitado la adiccion de duplicados