Examples of DecisionNode


Examples of edu.gmu.seor.prognos.unbbayesplugin.jt.prs.id.DecisionNode

   */
  public void removeVariable(Node variavel) {
    computeFactors();
    int index = variableList.indexOf(variavel);
    if (variavel.getType() == Node.DECISION_NODE_TYPE) {
      DecisionNode decision = (DecisionNode) variavel;
      int statesSize = variavel.getStatesSize();
      if (decision.hasEvidence()) {
        finding(variableList.size()-1, index, new int[variableList.size()], decision.getEvidence());
      } else {
//        sum(variaveis.size()-1, index, 0, 0);
        sum(index);
        for (int i = dataPT.size-1; i >= 0; i--) {
          dataPT.data[i] = dataPT.data[i] / statesSize;
View Full Code Here

Examples of edu.gmu.seor.prognos.unbbayesplugin.jt.prs.id.DecisionNode

   */ 
  public void removeVariable(Node variable, boolean normalize){
    computeFactors();
    int index = variableList.indexOf(variable);
    if (variable.getType() == Node.DECISION_NODE_TYPE) {
      DecisionNode decision = (DecisionNode) variable;
      int statesSize = variable.getStatesSize();
      if (decision.hasEvidence()) {
        finding(variableList.size()-1, index, new int[variableList.size()], decision.getEvidence());
      } else {
        sum(index);
        for (int i = dataPT.size-1; i >= 0; i--) {
          dataPT.data[i] = dataPT.data[i] / statesSize;
        }
View Full Code Here

Examples of org.eclipse.uml2.uml.DecisionNode

        currentNode = newNode;
      }
    }
   
    private void visitDecisionNode() {
      DecisionNode decisionNode = (DecisionNode) currentNode.getActivityNode();
     
      double normalizationFactor = decisionNode.getOutgoings().size();
      //TODO write code to compute the normalization factor
     
      // remove decision node from execution branch
      ExecutionNode parentNode = currentNode.getParent();
      parentNode.removeChild(currentNode);
      currentNode = parentNode;
     
      // check if we have already decided
      DecisionContainer container = null;
      for (int i = 0; i < decisionContainers.size(); i++) {
        DecisionContainer temp = decisionContainers.get(i);
        if (temp.getDecisionNode().equals(decisionNode)) { // we have already taken a decision
          // reset subsequent decisions
          for (int j = i + 1; j < decisionContainers.size(); j++) {
            decisionContainers.remove(i+1);
          }
          container = temp;
        }
      }
     
      if (container == null) { // create a decision container if not present
        container = new DecisionContainer(decisionNode);
        for (ActivityEdge edge : decisionNode.getOutgoings()) {
          container.addDecision(new Decision(edge, 1d / normalizationFactor));
        }
        decisionContainers.add(container);
      }
     
      boolean flag = true;
      for (ActivityEdge edge : decisionNode.getOutgoings()) {
        ActivityNode target = edge.getTarget();
        Decision decision = container.findDecision(edge);
       
        if (decision.doTakeDecision()) { // we are taking this edge
          double newChance = parentNode.getChance() * 1d / normalizationFactor;
View Full Code Here

Examples of org.openbp.core.model.item.process.DecisionNode

      }

      if (node instanceof DecisionNode)
      {
        // Decision node: if-then-else statement
        DecisionNode decisionNode = (DecisionNode) node;

        // Determine the outgoing sockets of the decision node
        // and advance to the entry socket of the next nodes.
        NodeSocket yesSocket = getNamedSocket(node, CoreConstants.SOCKET_YES);
        yesSocket = ((ControlLink) yesSocket.getControlLinks().next()).getTargetSocket();
View Full Code Here

Examples of org.openbp.core.model.item.process.DecisionNode

   */
  public void executeModelObject(ModelObject mo, EngineExecutor ee)
  {
    TokenContext context = ee.getTokenContext();
    NodeSocket entrySocket = context.getCurrentSocket();
    DecisionNode node = (DecisionNode) entrySocket.getNode();

    boolean result = false;

    String expression = node.getExpression();
    if (expression != null)
    {
      // Evaluate a script expression
      ScriptEngine scriptEngine = getEngine().getScriptEngineFactory().obtainScriptEngine(context);
      try
View Full Code Here

Examples of org.openiaml.model.model.operations.DecisionNode

    setGeneratedBy(operation, by);
    return operation;
  }

  public DecisionNode generatedDecisionNode(GeneratesElements by, ActivityOperation container) throws InferenceException {
    DecisionNode operation = (DecisionNode) createElement( container, OperationsPackage.eINSTANCE.getDecisionNode(), OperationsPackage.eINSTANCE.getActivityOperation_Nodes() );
    setGeneratedBy(operation, by);
    return operation;
  }
View Full Code Here

Examples of org.openiaml.model.model.operations.DecisionNode

    setGeneratedBy(operation, by);
    return operation;
  }

  public DecisionNode generatedDecisionNode(GeneratesElements by, ActivityPredicate container) throws InferenceException {
    DecisionNode operation = (DecisionNode) createElement( container, OperationsPackage.eINSTANCE.getDecisionNode(), OperationsPackage.eINSTANCE.getActivityPredicate_Nodes() );
    setGeneratedBy(operation, by);
    return operation;
  }
View Full Code Here

Examples of org.openiaml.model.model.operations.DecisionNode

        // check for shortcut status if necessary
        if (!checkShortcut || isShortcut(s) == shortcutRequired) {
          EObject obj = s.resolveSemanticElement();
          if (objectClass.isInstance(obj)) {
            // check containing feature name
            DecisionNode e = (DecisionNode) obj;
            if (name == null || (e.getName() != null && e.getName().equals(name))) {
              if (containingFeature == null || containingFeature.equals(obj.eContainingFeature())) {
              assertNotNull(s);
              return s;
              }
            }
            found += e.getName() + "[" + obj.eContainingFeature() + "],";
          }
        }
      }
    }
View Full Code Here

Examples of org.openiaml.model.model.operations.DecisionNode

    assertNotGenerated(instance);
    BuiltinProperty exists = (BuiltinProperty) instance.getEmpty();
    assertGenerated(exists);

    // has a DecisionNode
    DecisionNode node = assertHasDecisionNode(check, "true?");
    assertGenerated(node);

    // DecisionNode evaluates the incoming condition
    SimpleCondition edge = assertHasSimpleCondition(session, exists, node);
    assertGenerated(edge);
View Full Code Here

Examples of org.openiaml.model.model.operations.DecisionNode

    InputTextField email2 = assertHasInputTextField(home, "Email 2");
    Value fieldValue2 = assertHasFieldValue(email2);

    // now we can check the contents
    StartNode start = assertHasStartNode(validate);
    DecisionNode check = assertHasDecisionNode(validate, "can cast?");
    assertHasExecutionEdge(validate, start, check);

    CastNode cast = assertHasCastNode(validate);
   
    // cast <- ExternalValue <- fieldValue
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.