Examples of PrioritizedElement


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

      List<Decomposition> outgoingDecompositions,
      List<Decomposition> incomingDecompositions) {

    if (selectedElementsMap.containsKey(element))
      return;
    PrioritizedElement prioritizedElement = QueryFactory.eINSTANCE.createPrioritizedElement();
    prioritizedElement.setElement(element);

    new AddPrioritizedElementCommand(priorizedElementSet, prioritizedElement, outgoingDecompositions, incomingDecompositions).runAsJob();
    selectedElementsMap.put(element, prioritizedElement);
  }
View Full Code Here

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

   */
  protected List<Decomposition> getIncomingDecompositions(GraphNode node) {
    List<Decomposition> result = new ArrayList<Decomposition>();
    for (Object connection : node.getTargetConnections()){
      Element element = ((GSSElementGraphNode)((GraphConnection) connection).getSource()).getElement();
      PrioritizedElement priorizedElement = findPrioritizedElementForElement(element);
      if (priorizedElement!= null)
        result.add((Decomposition)findRelationForConnection((GraphConnection)connection));
     

    }
View Full Code Here

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

   */
  protected List<Decomposition> getOutgoingDecomposition(GraphNode node) {
    List<Decomposition> result = new ArrayList<Decomposition>();
    for (Object connection : node.getSourceConnections()){
      Element element =  ((GSSElementGraphNode)((GraphConnection) connection).getDestination()).getElement();
      PrioritizedElement priorizedElement = findPrioritizedElementForElement(element);
      if (priorizedElement!= null)
      result.add((Decomposition)findRelationForConnection((GraphConnection)connection));
    }
    return result;
  }
View Full Code Here

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

        }
    }

    for (int i = priorizedElementSet
        .getPrioritizedElements().size()-1; i>=0;i--) {
      PrioritizedElement selectedPrinciple = priorizedElementSet
          .getPrioritizedElements().get(i);
      Element element = selectedPrinciple.getElement();
      GSSElementGraphNode node = (GSSElementGraphNode) getNodeForElement(selectedPrinciple
          .getElement());
     
     
      if (node == null) { //due to changes principle is no longer applicable
        if( displayQuestionMessagebox(element.getName() + " is no longer applicable. Deselect Principle?")){
View Full Code Here

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

    int prioritySum = 0;
    int countOfElements = roots.size();
    int countOfLockedElements = 0; // lockedGoals.size();

    for (Element element : roots) {
      PrioritizedElement priorizedElement = priorizedElementMap
          .get(element);
      String priorityString = priorizedElement.getGlobalPriority();
      if (priorityString != null) {
        prioritySum += Integer.parseInt(priorityString);
      }

      if (isLocked(element)) {

        countOfLockedElements++;
      }
    }

    int countOfNotLockedElement = countOfElements - countOfLockedElements;
    int notAssignedLocalPrioritysumOfNotLocked = 100 - prioritySum;

    int diffForEachNotLockedElement = countOfNotLockedElement != 0 ? notAssignedLocalPrioritysumOfNotLocked
        / countOfNotLockedElement
        : 0;

    int modulo = countOfNotLockedElement != 0 ? notAssignedLocalPrioritysumOfNotLocked
        % countOfNotLockedElement
        : 0;

    int i = 0;

    if (notAssignedLocalPrioritysumOfNotLocked != 0) {

      for (Element element : roots) {

        if (!isLocked(element)) {
          i++;

          PrioritizedElement priorizedElement = priorizedElementMap
              .get(element);
          String oldPriorityString = priorizedElement
              .getGlobalPriority();
          int oldPriorityInt = oldPriorityString != null ? Integer
              .parseInt(oldPriorityString) : 0;
          int newPriorityInt = oldPriorityInt
              + diffForEachNotLockedElement;
          if (modulo >= i)
            newPriorityInt++;

          String newPrioritySting = String.valueOf(newPriorityInt);
          priorizedElement.setGlobalPriority(newPrioritySting);

        }
      }
    }
View Full Code Here

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

   *            the global priority of the new PrioritizedElement
   * @return the created PrioritizedElement
   */
  protected PrioritizedElement createSelectedGoal(GSSQuery query, Goal goal,
      int globalPriority) {
    PrioritizedElement selectedGoal = QueryFactory.eINSTANCE
        .createPrioritizedElement();
    selectedGoal.setElement(goal);
    selectedGoal.setGlobalPriority(String.valueOf(globalPriority));

    if (query.getSelectedGoalsSet() == null)
      query.setSelectedGoalsSet(QueryFactory.eINSTANCE
          .createSelectedGoalsSet());
    query.getSelectedGoalsSet().getPrioritizedElements().add(selectedGoal);
View Full Code Here

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

   *            the global priority of the new PrioritizedElement
   * @return the created PrioritizedElement
   */
  protected PrioritizedElement createSelectedPrinciple(GSSQuery query,
      Principle principle, int globalPriority) {
    PrioritizedElement selectedPrinciple = QueryFactory.eINSTANCE
        .createPrioritizedElement();
    selectedPrinciple.setElement(principle);
    selectedPrinciple.setGlobalPriority(String.valueOf(globalPriority));

    if (query.getSelectedPrinciplesSet() == null)
      query.setSelectedPrinciplesSet(QueryFactory.eINSTANCE
          .createSelectedPrinciplesSet());
    query.getSelectedPrinciplesSet().getPrioritizedElements()
View Full Code Here

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

   * @param element
   *            an Element
   * @return the priority
   */
  public Float getPrioritizedElementPriority(Element element) {
    PrioritizedElement prioritizedElement = getPrioritizedElement(element);
    return prioritizedElementWeightsMap.get(prioritizedElement);
  }
View Full Code Here

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

   * @param newPriority
   *            the new priority
   */
  private void setPrioritizedElementPriority(Element element,
      Float newPriority) {
    PrioritizedElement prioritizedElement = getPrioritizedElement(element);
    prioritizedElementWeightsMap.put(prioritizedElement, newPriority);
  }
View Full Code Here

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

   */
  public void removeMarkedElementsAndDecompositions() {

    for (Element element : elementsToRemove) {

      PrioritizedElement prioritizedElement = prioritizedElementMap
          .get(element);
      prioritizedElementMap.remove(element);
      elementMap.remove(prioritizedElement);
      prioritizedElementWeightsMap.remove(prioritizedElement);
      sourcesMap.remove(element);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.