Пример #1
0
        public string toString(APSet ap_set, bool spaces)
        {
            if (ap_set.size() == 0)
            {
                return("\u03A3");
            }
            StringBuilder r = new StringBuilder();

            for (int i = 0; i < ap_set.size(); i++)
            {
                if (i >= 1)
                {
                    r.Append("&");
                }
                if (!this.get(i))
                {
                    r.Append("!");
                }
                else
                {
                    if (spaces)
                    {
                        r.Append(" ");
                    }
                }
                r.Append(ap_set.getAP(i));
            }
            return(r.ToString());
        }
Пример #2
0
 /** Switch the APSet to another with the same number of APs. */
 public void switchAPSet(APSet new_apset)
 {
     if (new_apset.size() != _apset.size())
     {
         throw new IllegalArgumentException("New APSet has to have the same size as the old APSet!"); //IllegalArgument
     }
     _apset = new_apset;
 }
Пример #3
0
        public EdgeContainerExplicit_APElement <BitSet> _container; //<BitSet>



        /**
         * Constructor.
         * @param state the NBA_State owning this EdgeManager
         * @param apset the underlying APSet
         */
        public NBA_State_EdgeManager(NBA_State state, APSet apset)
        {
            _state     = state;
            _container = new EdgeContainerExplicit_APElement <BitSet>(apset.size());

            //for (APSet::element_iterator eit=apset.all_elements_begin(); eit!=apset.all_elements_end(); ++eit) {
            for (int i = apset.all_elements_begin(); i != apset.all_elements_end(); i++)
            {
                _container.addEdge(new APElement(i), new BitSet());
            }
        }
Пример #4
0
        /**
         * Increment the iterator (used by the boost iterator base class).
         */
        public void increment()
        {
            //BitSet set_mask = new BitSet(_m.getSetBits());
            BitSet set_mask = _m.getSetBits().getBitSetObject();
            int    i        = set_mask.nextClearBit(0);

            while (i < _ap_set.size())
            {
                if (_cur_e.get(i) == false)
                {
                    _cur_e.set(i, true);
                    return;
                }
                else
                {
                    _cur_e.set(i, false);
                    i = set_mask.nextClearBit(i + 1);
                }
            }

            // overflow -> end
            _end_marker = true;
        }
Пример #5
0
 public string toString(APSet ap_set, bool spaces)
 {
     if (ap_set.size() == 0)
     {
         return "\u03A3";
     }
     StringBuilder r = new StringBuilder();
     for (int i = 0; i < ap_set.size(); i++)
     {
         if (i >= 1)
         {
             r.Append("&");
         }
         if (!this.get(i))
         {
             r.Append("!");
         }
         else
         {
             if (spaces)
             {
                 r.Append(" ");
             }
         }
         r.Append(ap_set.getAP(i));
     }
     return r.ToString();
 }
Пример #6
0
  public EdgeContainerExplicit_APElement<BitSet> _container; //<BitSet>

  

  /**
   * Constructor.
   * @param state the NBA_State owning this EdgeManager
   * @param apset the underlying APSet   
   */
  public NBA_State_EdgeManager(NBA_State state, APSet apset)
  {

      _state = state;
      _container = new EdgeContainerExplicit_APElement<BitSet>(apset.size());

      //for (APSet::element_iterator eit=apset.all_elements_begin(); eit!=apset.all_elements_end(); ++eit) {
      for (int i = apset.all_elements_begin(); i != apset.all_elements_end(); i++)
      {
          _container.addEdge(new APElement(i), new BitSet());
      }

  }
Пример #7
0
        /**
         * Switch the APSet to another with the same number of APs.
         */
        public void switchAPSet(APSet new_apset)
        {
            if (new_apset.size() != _apset.size())
            {
                throw new IllegalArgumentException("New APSet has to have the same size as the old APSet!");
            }

            _apset = new_apset;
        }
Пример #8
0
 /**
  * Get the size of the underlying APSet.
  */
 public int getAPSize()
 {
     return(_ap_set.size());
 }