Examples of PaStepStub


Examples of q_impress.pmi.lib.decorators.marte.PaStepDecorator.PaStepStub

        }
      }
    }
   
    ActionDecorator nodeDec;
    PaStepStub paStepStub;
    try {
      nodeDec = (ActionDecorator) translator.getDecoratorsFactory().getDecorator(node);
      paStepStub = nodeDec.getPaStepStub();
      if (paStepStub == null) throw new TranslationException(this, "Unable to generate property for node \"" + node.getQualifiedName() + "\" : no PaStep stereotype associated.");
    } catch (InvalidContextException e) {
      throw new TranslationException(this, "Unable to generate property for node \"" + node.getQualifiedName() + "\"", e);
    } catch (ClassNotFoundException e) {
      throw new TranslationException(this, "Unable to generate property for node \"" + node.getQualifiedName() + "\"", e);
    }
   
   
    String comment = "Reliability value computed from " + nodeName;
    String rule = chosenProp;
    if (paStepStub.getRep() > 1) {
      for (int i = 0; i < paStepStub.getRep(); i++) {
        printComment(comment + " after " + Integer.toString(i) + " attempts.");
       
        rule = chosenProp;
        rule += " { " + nodeTranslator.getStateVariable() + " = " + Integer.toString(state + i) ;
        rule += extraPredicates + " }";
View Full Code Here

Examples of q_impress.pmi.lib.decorators.marte.PaStepDecorator.PaStepStub

    }
   
    double outProb = 1d;
    double negProb = 0d;
   
    PaStepStub stub = actionDec.getPaStepStub();
    if (stub == null) {
      throw new TranslationException(this, "Unable to visit node \"" + node.getQualifiedName() + "\" : no PaStep stereotype associated.");
    }
   
    outProb = stub.getProb();
    negProb = 1d - outProb;
   
    if (stub.getRep() > 1) { // the execution may be retried
      // reserve needed state numbers
      int thisNodeStateNumber = getStateNumber(node);
      int firstStateNumber = reserveStateNumbers(stub.getRep() - 1);
      int lastStateNumber = firstStateNumber + stub.getRep() - 2;
     
      // create the transition for the first n-1 re-trials
      this.openGuard();
      this.createGuardCondition(stateVarName + " >= " + thisNodeStateNumber);
      this.addGuardCondition(stateVarName + " < " + (lastStateNumber));
View Full Code Here

Examples of q_impress.pmi.lib.decorators.marte.PaStepDecorator.PaStepStub

   * Gets the artifact that implements this action.
   * @return the artifact if found, otherwise null.
   */
  public Artifact getImplementingArtifact() {
    if (implementingArtifact == null) {
      PaStepStub paStepStub = getPaStepStub();
      if (paStepStub.getHost() != null) {
        implementingArtifact = paStepStub.getHost();
      }
    }
   
    return implementingArtifact;
  }
View Full Code Here

Examples of q_impress.pmi.lib.decorators.marte.PaStepDecorator.PaStepStub

  /**
   * Gets the probability of taking this edge.
   * @return the probability.
   */
  public double getProbability() {
    PaStepStub stub = getPaStepStub();
    return stub.getProb();
  }
View Full Code Here

Examples of q_impress.pmi.lib.decorators.marte.PaStepDecorator.PaStepStub

   
    // compute loads
    for (Action action : path) {
      try {
        ActionDecorator actionDec = (ActionDecorator) decFactory.getDecorator(action);
        PaStepStub paStub = actionDec.getPaStepStub();
       
        // parse load string
        String hostDemandRep = paStub.getHostDemand();
        if (hostDemandRep == null) hostDemandRep = "";
        Map<RESOURCE_TYPE,Double> demands = LoadInfo.parseDemandString(hostDemandRep);
       
        Artifact artifact = actionDec.getImplementingArtifact();
        if (artifact != null) { // update loads
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.