Esempio n. 1
0
        /** Calculate the SCCs*/
        public void calculate(bool disjoint)
        {
            current_dfs_nr = 0;
            //_dfs_data.Clear();

            // Ensure there are as many entries as there are graph-states
            //_dfs_data.resize(_graph.size());
            //Ultility.resize(_dfs_data, _graph.size());
            Ultility.resizeExact(_dfs_data, _graph.size());

            scc_nr = 0;

            NBA_State start_state = _graph.getStartState();

            if (start_state == null)
            {
                return;
            }

            if (!disjoint)
            {
                int start_idx = start_state.getName();
                visit(start_idx);
            }
            else
            {
                // The Graph may be disjoint -> restart DFS on every not yet visited state
                for (int v = 0; v < _graph.size(); ++v)
                {
                    if (_dfs_data[v] == null) //.get()
                    {
                        // not yet visited
                        visit(v);
                    }
                }
            }

            calculateDAG();
        }
Esempio n. 2
0
  ///** Get the target states */
  //public BitSet getEdge(APMonom monom) {
  //  throw new Exception("Not implemented!");
  //}

  /** Add an edge. */
  public void addEdge(APElement label, NBA_State state) {
    _container.get(label).set(state.getName());///////////////note here
    //_container.addEdgeDebug(label.getBitSet(), state.getName());
  }
Esempio n. 3
0
        ///** Get the target states */
        //public BitSet getEdge(APMonom monom) {
        //  throw new Exception("Not implemented!");
        //}

        /** Add an edge. */
        public void addEdge(APElement label, NBA_State state)
        {
            _container.get(label).set(state.getName());///////////////note here
            //_container.addEdgeDebug(label.getBitSet(), state.getName());
        }