Package org.emftrace.metamodel.QUARCModel.Query

Examples of org.emftrace.metamodel.QUARCModel.Query.PrioritizedElement


  public void testRepairPrioritiesAndWeightsRootsWithNullPriority(){
   
    Goal goal1 = createGoal(gss, 1);
    Goal goal2 = createGoal(gss, 2);
   
    PrioritizedElement sg1 =  createSelectedGoal(gssQuery, goal1, 0);
    PrioritizedElement sg2 =createSelectedGoal(gssQuery, goal2, 0);

    sg1.setGlobalPriority(null);
    sg2.setGlobalPriority(null);

    executeRequiredPhases();
   
    priorizedElementsCache.repairPrioritiesAndWeights();
   
View Full Code Here


    Goal goal1 = createGoal(gss, 1);
    Goal goal2 = createGoal(gss, 2);


    createSelectedGoal(gssQuery, goal1, 100);
    PrioritizedElement selectedGoal2 = createSelectedGoal(gssQuery, goal2, 100);

    Decomposition decomposition = createDecomposition(gss, goal2, goal1);
    PrioritizedDecomposition priorizedDecomposition = createPriorizedDecomposition(gssQuery, decomposition, 100);

View Full Code Here

    Goal g3 = createGoal(gss, 3);
   
    Decomposition d1 = createDecomposition(gss, g2, g1);
    Decomposition d2 = createDecomposition(gss, g3, g1);
   
    PrioritizedElement selectedGoal1 = createSelectedGoal(gssQuery, g1, 0);
    PrioritizedElement selectedGoal2 = QueryFactory.eINSTANCE.createPrioritizedElement();
    selectedGoal2.setElement(g2);
   
    List<Decomposition> outgoingDecompositions = new ArrayList<Decomposition>();
    List<Decomposition> incomingDecompositions = new ArrayList<Decomposition>();
   
    outgoingDecompositions.add(d1);
View Full Code Here

    Goal g3 = createGoal(gss, 3);
   
    Decomposition d1 = createDecomposition(gss, g2, g1);
    Decomposition d2 = createDecomposition(gss, g3, g2);
   
    PrioritizedElement selectedGoal1 = createSelectedGoal(gssQuery, g1, 0);
   
    PrioritizedElement selectedGoal2 = QueryFactory.eINSTANCE.createPrioritizedElement();
    selectedGoal2.setElement(g2);
   
    PrioritizedElement selectedGoal3 = createSelectedGoal(gssQuery, g3, 0);
   
    List<Decomposition> outgoingDecompositions = new ArrayList<Decomposition>();
    List<Decomposition> incomingDecompositions = new ArrayList<Decomposition>();
   
    outgoingDecompositions.add(d1);
View Full Code Here

   
    Decomposition d1 = createDecomposition(gss, g2, g1);
    Decomposition d2 = createDecomposition(gss, g3, g1);
   
   
    PrioritizedElement selectedGoal1 = QueryFactory.eINSTANCE.createPrioritizedElement();
    selectedGoal1.setElement(g1);
   
    PrioritizedElement selectedGoal2 = createSelectedGoal(gssQuery, g2, 0);
   
  //  PriorizedElement selectedGoal3 = createSelectedGoal(gssQuery, g3, 0);
   
    List<Decomposition> outgoingDecompositions = new ArrayList<Decomposition>();
    List<Decomposition> incomingDecompositions = new ArrayList<Decomposition>();
View Full Code Here

   
    Decomposition d1 = createDecomposition(gss, g2, g1);
    Decomposition d2 = createDecomposition(gss, g3, g1);
   
   
    PrioritizedElement selectedGoal1 =  QueryFactory.eINSTANCE.createPrioritizedElement();
    selectedGoal1.setElement(g1);
   
    PrioritizedElement selectedGoal2 = createSelectedGoal(gssQuery, g2, 0);
   
    PrioritizedElement selectedGoal3 = createSelectedGoal(gssQuery, g3, 0);
   
    List<Decomposition> outgoingDecompositions = new ArrayList<Decomposition>();
    List<Decomposition> incomingDecompositions = new ArrayList<Decomposition>();
   
    incomingDecompositions.add(d1);
View Full Code Here

    createPriorizedDecomposition(gssQuery, d2, 0);

    createPriorizedDecomposition(gssQuery, d4, 0)

    PrioritizedElement selectedGoal1 = createSelectedGoal(gssQuery, g1, 0);
   
    PrioritizedElement selectedGoal2 =  QueryFactory.eINSTANCE.createPrioritizedElement();
    selectedGoal2.setElement(g2);
   
   
    PrioritizedElement selectedGoal3 = createSelectedGoal(gssQuery, g3, 0);
    PrioritizedElement selectedGoal4 = createSelectedGoal(gssQuery, g4, 0);
   
    List<Decomposition> outgoingDecompositions = new ArrayList<Decomposition>();
    List<Decomposition> incomingDecompositions = new ArrayList<Decomposition>();
   
    incomingDecompositions.add(d3);
    outgoingDecompositions.add(d1);
   
    new AddPrioritizedElementCommand(gssQuery.getSelectedGoalsSet(), selectedGoal2, outgoingDecompositions, incomingDecompositions).runWithoutUnicaseCommand();
   
    incomingDecompositions.clear();
    outgoingDecompositions.clear();
   
    outgoingDecompositions.add(d3);
    outgoingDecompositions.add(d4);
   
   
    PrioritizedElement selectedGoal4clone = QueryFactory.eINSTANCE.createPrioritizedElement();
    selectedGoal4clone.setElement(g4);
    new AddPrioritizedElementCommand(gssQuery.getSelectedGoalsSet(), selectedGoal4clone, outgoingDecompositions, incomingDecompositions).runWithoutUnicaseCommand();
   
   
    assertEquals(4, gssQuery.getSelectedGoalsSet().getPrioritizedElements().size());
   
View Full Code Here

    Goal g1 = createGoal(gss, 1);
    Goal g2 = createGoal(gss, 2);
    Goal g3 = createGoal(gss, 3);
   
   
    PrioritizedElement sg1 = createSelectedGoal(gssQuery, g1, 45);
    PrioritizedElement sg2 = createSelectedGoal(gssQuery, g2, 20);
    PrioritizedElement sg3 = createSelectedGoal(gssQuery, g3, 20);
   
   
    new RepairPrioritizedElemenetsPrioritiesCommand( gssQuery.getSelectedGoalsSet()).runWithoutUnicaseCommand();
   
   
    assertEquals("50",sg1.getGlobalPriority());
    assertEquals("25", sg2.getGlobalPriority());
    assertEquals("25", sg3.getGlobalPriority());
   
    assertEquals(false,gssQuery.getSelectedGoalsSet().isChanged() );

  }
View Full Code Here

    Goal g1 = createGoal(gss, 1);
    Goal g2 = createGoal(gss, 2);
    Goal g3 = createGoal(gss, 3);
   
   
    PrioritizedElement sg1 = createSelectedGoal(gssQuery, g1, 50);
    PrioritizedElement sg2 = createSelectedGoal(gssQuery, g2, 20);
    PrioritizedElement sg3 = createSelectedGoal(gssQuery, g3, 20);
   
    Map<Element, Boolean> lockedMap = new HashMap<Element, Boolean>();
    lockedMap.put(g1, true);
    lockedMap.put(g2, false);
   
   
    new RepairPrioritizedElemenetsPrioritiesCommand( gssQuery.getSelectedGoalsSet(), lockedMap).runWithoutUnicaseCommand();
   
   
    assertEquals("50",sg1.getGlobalPriority());
    assertEquals("25", sg2.getGlobalPriority());
    assertEquals("25", sg3.getGlobalPriority());
   
    assertEquals(false,gssQuery.getSelectedGoalsSet().isChanged() );

  }
View Full Code Here

    Goal g4 = createGoal(gss, 4);
   
    Decomposition d1 = createDecomposition(gss, g2, g1);
    Decomposition d2 = createDecomposition(gss, g3, g1);
   
    PrioritizedElement sg1 = createSelectedGoal(gssQuery, g1, 50);
    PrioritizedElement sg2 = createSelectedGoal(gssQuery, g2, 25);
    PrioritizedElement sg3 = createSelectedGoal(gssQuery, g3, 25);
    PrioritizedElement sg4 = createSelectedGoal(gssQuery, g4, 50);
   
    createPriorizedDecomposition(gssQuery, d1, 50);
    createPriorizedDecomposition(gssQuery, d2, 50);
   
    Map<Element, Boolean> lockedMap = new HashMap<Element, Boolean>();
    lockedMap.put(g1, true);
    lockedMap.put(g2, false);
   
   
    new RepairPrioritizedElemenetsPrioritiesCommand( gssQuery.getSelectedGoalsSet(), lockedMap).runWithoutUnicaseCommand();
   
   
    assertEquals("50",sg1.getGlobalPriority());
    assertEquals("25", sg2.getGlobalPriority());
    assertEquals("25", sg3.getGlobalPriority());
   
    assertEquals("50", sg4.getGlobalPriority());
    assertEquals(false,gssQuery.getSelectedGoalsSet().isChanged() );
  }
View Full Code Here

TOP

Related Classes of org.emftrace.metamodel.QUARCModel.Query.PrioritizedElement

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.