Package org.ggp.base.util.propnet.architecture.components

Examples of org.ggp.base.util.propnet.architecture.components.Constant


    if ( literal instanceof GdlDistinct )
    {
      GdlDistinct distinct = (GdlDistinct) literal;

      Proposition proposition = new Proposition(GdlPool.getProposition(GdlPool.getConstant("anon")));
      Constant constant = new Constant(!distinct.getArg1().equals(distinct.getArg2()));

      link(constant, proposition);

      components.add(proposition);
      components.add(constant);
View Full Code Here


      components.add(init);
      components.add(transition);
      components.add(proposition);
    }

    Constant constant = new Constant(true);
    Proposition proposition = getProposition(sentence);

    link(constant, proposition);

    components.add(constant);
View Full Code Here

      System.out.println("done");

    List<Role> roles = Role.computeRoles(description);
    Map<GdlSentence, Component> components = new HashMap<GdlSentence, Component>();
    Map<GdlSentence, Component> negations = new HashMap<GdlSentence, Component>();
    Constant trueComponent = new Constant(true);
    Constant falseComponent = new Constant(false);
    Map<SentenceForm, FunctionInfo> functionInfoMap = new HashMap<SentenceForm, FunctionInfo>();
    Map<SentenceForm, Collection<GdlSentence>> completedSentenceFormValues = new HashMap<SentenceForm, Collection<GdlSentence>>();
    for(SentenceForm form : topologicalOrdering) {
      ConcurrencyUtils.checkForInterruption();
View Full Code Here

        }
        toAdd.add(Pair.of((Component) inputProp, typeToAdd));
      }
      }

      Constant trueConst = new Constant(true);
      Constant falseConst = new Constant(false);
      pn.addComponent(trueConst);
      pn.addComponent(falseConst);
      //Make them the input of all false/true components
      for(Entry<Component, Type> entry : reachability.entrySet()) {
          Type type = entry.getValue();
          if(type == Type.TRUE || type == Type.FALSE) {
              Component c = entry.getKey();
              if (c instanceof Constant) {
                //Don't bother trying to remove this
                continue;
              }
              //Disconnect from inputs
              for(Component input : c.getInputs()) {
                  input.removeOutput(c);
              }
              c.removeAllInputs();
              if(type == Type.TRUE ^ (c instanceof Not)) {
                  c.addInput(trueConst);
                  trueConst.addOutput(c);
              } else {
                    c.addInput(falseConst);
                    falseConst.addOutput(c);
              }
          }
      }

      optimizeAwayTrueAndFalse(pn, trueConst, falseConst);
View Full Code Here

TOP

Related Classes of org.ggp.base.util.propnet.architecture.components.Constant

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.