Examples of TransitionModel


Examples of aima.core.probability.hmm.TransitionModel

  }

  @Test
  public void testTransitionModelGeneratesNewStateWhenGivenOldStateAndProbability() {

    TransitionModel tm = rainman.transitionModel();
    String oldState = HmmConstants.RAINING;
    String state1 = tm.getStateForProbability(oldState,
        randomizer.nextDouble());
    String state2 = tm.getStateForProbability(oldState,
        randomizer.nextDouble());
    Assert.assertEquals(state1, HmmConstants.RAINING);
    Assert.assertEquals(state2, HmmConstants.NOT_RAINING);
  }
View Full Code Here

Examples of edu.cmu.sphinx.linguist.acoustic.tiedstate.kaldi.TransitionModel

     *
     * @throws IOException if an error occurs while loading the model
     */
    public void load() throws IOException {
        KaldiTextParser parser = new KaldiTextParser(location);
        TransitionModel transitionModel = new TransitionModel(parser);
        senonePool = new KaldiGmmPool(parser);

        File file = new File(location, "phones.txt");
        InputStream stream = new URL(file.getPath()).openStream();
        Reader reader = new InputStreamReader(stream);
View Full Code Here

Examples of org.springframework.webflow.engine.model.TransitionModel

    output.setRequired(element.getAttribute("required"));
    return output;
  }

  private TransitionModel parseTransition(Element element) {
    TransitionModel transition = new TransitionModel();
    transition.setOn(element.getAttribute("on"));
    transition.setTo(element.getAttribute("to"));
    transition.setOnException(element.getAttribute("on-exception"));
    transition.setBind(element.getAttribute("bind"));
    transition.setValidate(element.getAttribute("validate"));
    transition.setHistory(element.getAttribute("history"));
    transition.setAttributes(parseAttributes(element));
    transition.setSecured(parseSecured(element));
    transition.setActions(parseActions(element));
    return transition;
  }
View Full Code Here

Examples of org.springframework.webflow.engine.model.TransitionModel

    assertTrue(rule.getAttributes().contains("ROLE_USER"));
  }

  public void testFlowSecuredTransition() {
    model.setStates(singleList(new EndStateModel("end")));
    TransitionModel transition = new TransitionModel();
    transition.setTo("end");
    transition.setSecured(new SecuredModel("ROLE_USER"));
    model.setGlobalTransitions(singleList(transition));
    Flow flow = getFlow(model);
    SecurityRule rule = (SecurityRule) flow.getGlobalTransitionSet().toArray()[0].getAttributes().get(
        SecurityRule.SECURITY_ATTRIBUTE_NAME);
    assertNotNull(rule);
View Full Code Here

Examples of org.springframework.webflow.engine.model.TransitionModel

  private FlowExecutionExceptionHandler[] parseTransitionExecutingExceptionHandlers(List transitionModels) {
    if (transitionModels != null && !transitionModels.isEmpty()) {
      List exceptionHandlers = new ArrayList(transitionModels.size());
      for (Iterator it = transitionModels.iterator(); it.hasNext();) {
        TransitionModel model = (TransitionModel) it.next();
        if (StringUtils.hasText(model.getOnException())) {
          if (model.getSecured() != null) {
            throw new FlowBuilderException("Exception based transitions cannot be secured");
          }
          exceptionHandlers.add(parseTransitionExecutingExceptionHandler(model));
        }
      }
View Full Code Here

Examples of org.springframework.webflow.engine.model.TransitionModel

  private Transition[] parseTransitions(List transitionModels) {
    if (transitionModels != null && !transitionModels.isEmpty()) {
      List transitions = new ArrayList(transitionModels.size());
      if (transitionModels != null) {
        for (Iterator it = transitionModels.iterator(); it.hasNext();) {
          TransitionModel transition = (TransitionModel) it.next();
          if (!StringUtils.hasText(transition.getOnException())) {
            transitions.add(parseTransition(transition));
          }
        }
      }
      return (Transition[]) transitions.toArray(new Transition[transitions.size()]);
View Full Code Here

Examples of org.springframework.webflow.engine.model.TransitionModel

    assertTrue(rule.getAttributes().contains("ROLE_USER"));
  }

  public void testFlowSecuredTransition() {
    model.setStates(asList(AbstractStateModel.class, new EndStateModel("end")));
    TransitionModel transition = new TransitionModel();
    transition.setTo("end");
    transition.setSecured(new SecuredModel("ROLE_USER"));
    model.setGlobalTransitions(asList(TransitionModel.class, transition));
    Flow flow = getFlow(model);
    SecurityRule rule = (SecurityRule) flow.getGlobalTransitionSet().toArray()[0].getAttributes().get(
        SecurityRule.SECURITY_ATTRIBUTE_NAME);
    assertNotNull(rule);
View Full Code Here

Examples of org.springframework.webflow.engine.model.TransitionModel

    FlowModel model = holder.getFlowModel();

    ViewStateModel state = (ViewStateModel) model.getStateById("state1");
    assertEquals("foo,bar", state.getValidationHints());

    TransitionModel transition = state.getTransitions().get(0);
    assertEquals("baz", transition.getValidationHints());

    state = (ViewStateModel) model.getStateById("state2");
    assertNull(state.getValidationHints());
  }
View Full Code Here

Examples of org.springframework.webflow.engine.model.TransitionModel

    output.setRequired(element.getAttribute("required"));
    return output;
  }

  private TransitionModel parseTransition(Element element) {
    TransitionModel transition = new TransitionModel();
    transition.setOn(element.getAttribute("on"));
    transition.setTo(element.getAttribute("to"));
    transition.setOnException(element.getAttribute("on-exception"));
    transition.setBind(element.getAttribute("bind"));
    transition.setValidate(element.getAttribute("validate"));
    transition.setValidationHints(element.getAttribute("validation-hints"));
    transition.setHistory(element.getAttribute("history"));
    transition.setAttributes(parseAttributes(element));
    transition.setSecured(parseSecured(element));
    transition.setActions(parseActions(element));
    return transition;
  }
View Full Code Here

Examples of org.woped.core.model.petrinet.TransitionModel

    Vector<ResourceClassModel> roles = ((PetriNetModelProcessor) (parentEditor
        .getModelProcessor())).getRoles();
    ((PetriNetModelProcessor) (getModelProcessor())).setRoles(roles);

    Map<String, AbstractPetriNetElementModel> transitions;
    TransitionModel trans;
    if (!(transitions = container.getElementsByType(2)).isEmpty()) {
      Iterator<AbstractPetriNetElementModel> iterTrans = transitions.values().iterator();
      while (iterTrans.hasNext()) {
        trans = (TransitionModel) iterTrans.next();
        if (trans.isIncommingTarget())
          createArc(this.m_subprocessInput.getId(), trans.getId());
        if (trans.isOutgoingSource())
          createArc(trans.getId(), this.m_subprocessOutput.getId());

      }
    }
    // Restore original "edited" status of parent editor
    // because creation of source and target places should not
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.