Examples of RuleGraph


Examples of lupos.gui.operatorgraph.visualeditor.visualrif.guielements.graphs.RuleGraph

    this.determineRootNodes();
  }

  protected AbstractGuiComponent<Operator> drawPanel(final GraphWrapper gw, final RuleGraph parent, final Color bgColor, final String title) {

    this.recursiveOperatorGraph = new RuleGraph(parent.getVisualEditor(),this.visualRifEditor,true);

    parent.addChildComponent(this.recursiveOperatorGraph);

    this.initRecursiveOperatorGraph(parent);
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.guielements.graphs.RuleGraph

    final JButton connectionButton = new JButton("Connection");

    connectionButton.addActionListener(new ActionListener(){
       @Override
      public void actionPerformed(final ActionEvent e) {
          final RuleGraph ruleGraph = (RuleGraph) ListOperatorPanel.this.parent;
          ruleGraph.getVisualEditor().connectionMode = new TermConnection(ruleGraph,ListOperatorPanel.this.listOperator,term);
          connectionButton.setEnabled(false);
           }});

    /*
     * Calibration
 
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.guielements.graphs.RuleGraph

    final JButton connectionButton = new JButton("Connection");
    connectionButton.addActionListener(new ActionListener(){
      @Override
      public void actionPerformed(final ActionEvent e) {
        final RuleGraph ruleGraph = (RuleGraph) ListOperatorPanel.this.parent;

        ruleGraph.getVisualEditor().connectionMode = new TermConnection(ruleGraph,ListOperatorPanel.this.listOperator,term);

        connectionButton.setEnabled(false);
      }});

    /*
 
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.guielements.graphs.RuleGraph

    final JButton connectionButton = new JButton("Connection");

    connectionButton.addActionListener(new ActionListener(){
       @Override
      public void actionPerformed(final ActionEvent e) {
          final RuleGraph ruleGraph = (RuleGraph) ListOperatorPanel.this.parent;
          ruleGraph.getVisualEditor().connectionMode = new TermConnection(ruleGraph,ListOperatorPanel.this.listOperator,term);
          connectionButton.setEnabled(false);
           }});

    /*
     * Calibration
 
View Full Code Here

Examples of lupos.gui.operatorgraph.visualeditor.visualrif.guielements.graphs.RuleGraph

  final JButton connectionButton = new JButton("Connection");
    connectionButton.addActionListener(new ActionListener(){
       @Override
      public void actionPerformed(final ActionEvent e) {
          final RuleGraph ruleGraph = (RuleGraph) ListOperatorPanel.this.parent;
          ruleGraph.getVisualEditor().connectionMode = new TermConnection(ruleGraph,ListOperatorPanel.this.listOperator,term);
          connectionButton.setEnabled(false);
           }});

    /*
     * Calibration
 
View Full Code Here

Examples of urban.shapes.RuleGraph

      Queue<RuleGraph> q = new LinkedList<RuleGraph>();
      q.add(merge);
     
      int i=1;
      while(!q.isEmpty()){
        RuleGraph graph = q.poll();
       
        Node root = graph.getRoot();
        if (root instanceof BondNode){
          Iterator<Entry<Link, RuleGraph>> children = sorted(graph.getChildren()).iterator();
          Entry<Link, RuleGraph> entry1 = children.next();
          Entry<Link, RuleGraph> entry2 = children.next();
         
          Node a = entry1.getValue().getRoot();
          Node b = entry2.getValue().getRoot();
          get(rhs,a).add(new Site(a.getName(), entry1.getKey().getDst(), null, ""+i));
          get(rhs,b).add(new Site(b.getName(), entry2.getKey().getDst(), null, ""+i));
          i++;
          q.add(entry1.getValue());
          q.add(entry2.getValue());
        } else {
          ordering.add(root);
          String agent = root.getName();
          List<Site> sitesL = get(lhs, root);
          List<Site> sitesR = get(rhs, root);
          addAll(sitesL, root.getSitesL());
          addAll(sitesR, root.getSitesR());
          for(Entry<Link, RuleGraph> e : sorted(graph.getChildren())){
            if (e.getValue() == null){
              String siteName = e.getKey().getSrc();
              sitesL.add(new Site(agent, siteName, null, "_"));
              sitesR.add(new Site(agent, siteName, null, "_"));         
            } else {
View Full Code Here

Examples of urban.shapes.RuleGraph

    if (r == null)
      return null;
   
    Data data = new Data(r.shape.getAgents());
   
    RuleGraph result = createRoot(r, data);
   
    fillDAG(data);
   
    return result;
  }
View Full Code Here

Examples of urban.shapes.RuleGraph

  private void fillDAG(Data data) {
    while(!data.q.isEmpty()){
      Pair<Agent,RuleGraph> p = data.q.poll();
      Agent aL = p.fst;
      RuleGraph current = p.snd;
      for(Site s : aL.getSites()){
        String m = s.getBindingMark();
        if (m != null && !"?".equals(m) && !"_".equals(m)){
          Pair<Agent,Site> p2 = data.getLinked(aL, m);
          if (p2 != null){
            Agent a = p2.fst;
            int indexOf = data.lhs.indexOf(a);
            if (data.rgArrays[indexOf] == null){
              data.rgArrays[indexOf] = new RuleGraph(new Node(a));
              data.q.add(pairOf(a,data.rgArrays[indexOf]));
            }
            RuleGraph value = data.rgArrays[indexOf];
            current.addChild(new Link(s.getName(),p2.snd.getName()), value);
          }
        }
        if ("_".equals(m)){
          current.addChild(new Link(s.getName(),"_"), null);
View Full Code Here

Examples of urban.shapes.RuleGraph

      }
    }
  }

  private RuleGraph createRoot(Shape.ShapePlusSite arg0, Data d) {
    RuleGraph rg;
    Site s = arg0.site;
    if (s.getState() == null){
      rg = new RuleGraph(new BondNode());
      RuleGraph r1 = new RuleGraph(new Node(arg0.agent));
      final Link key = new Link("1",s.getName());
      if (template == null){
        rg.addChild(key, r1);
        d.q.add(pairOf(arg0.agent, r1));
      } else {
        rg.addChild(key, template.getChildrenMap().get(key));
        rg.addChild(new Link("2",s.getName()), r1);
        d.q.add(pairOf(arg0.agent, r1));
      }
 
      Pair<Agent, RuleGraph> r2 = createRuleGraph(d, rg, arg0.agent, s);
      if (r2 != null && r2.fst != null)
        d.q.add(r2);
    } else {
      rg = new RuleGraph(new SiteNode(arg0.agent, s.getName(),s.getState()));
      d.q.add(pairOf(arg0.agent, rg));
    }
    return rg;
  }
View Full Code Here

Examples of urban.shapes.RuleGraph

  private Pair<Agent, RuleGraph> createRuleGraph(Data d, RuleGraph rg, Agent fst, Site s) {
    String bindingMark = s.getBindingMark();
 
    Pair<Agent,Site> other = d.getLinked(fst, bindingMark);
    if (other != null){
      RuleGraph r2 = new RuleGraph(new Node(other.fst));
      rg.addChild(new Link("2",other.snd.getName()), r2);
      return pairOf(other.fst, r2);
    }

    return null;
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.