Пример #1
0
 /**
  * @param ev
  * @param alphabet
  * @param bs
  * @param sup
  * @param seqDB
  * @param posDB
  * @param sInd
  * @param eInd
  */
 protected void verifyContentGeneralAcceptance(
     Event ev,
     Vector<Element> alphabet,
     BitSet bs,
     long[] sup,
     Vector<Integer>[] seqDB,
     Vector<Integer>[] posDB,
     int sInd,
     int eInd) {
   ItemSet set = ev.getSet();
   for (int i = 0; i < set.size(); i++) {
     Element el = set.elementAt(i);
     int found = alphabet.indexOf(el);
     if (-1 != found) {
       // If current sequence did not contribute to the support of
       // this element yet, increment its support
       if (!bs.get(found)) {
         sup[found]++;
         bs.set(found);
       }
       // In any case, add another object to projecyed db
       seqDB[found].addElement(new Integer(sInd));
       posDB[found].addElement(new Integer(eInd));
     }
   }
 }
Пример #2
0
 @Override
 protected void verifyContentAcceptance(
     EventSequence alpha,
     ItemSet set,
     Vector<Element> alphabet,
     int[] sup,
     ProjectedDB[] projDBs,
     int indProj,
     int sInd,
     int eInd,
     boolean inParallel,
     BitSet visited,
     BitSet accepted) {
   for (int i = 0; i < set.size(); i++) {
     Element el = set.elementAt(i);
     int found = alphabet.indexOf(el);
     if ((-1 != found)) {
       if (!visited.get(found)) {
         visited.set(found);
         accepted.set(found, isAcceptedByRelaxation(alpha, el, inParallel));
       }
       if (accepted.get(found)) {
         if (!projDBs[found].contains(sInd)) sup[found]++;
         projDBs[found].set(sInd, eInd);
       }
     }
   }
 }
Пример #3
0
 /**
  * Verifies the support and creates the infrastructure to generate initial projectedDBs for each
  * element in the database.
  *
  * @param s The db sequence to verify.
  * @param alphabet The set of elements in the db.
  * @param sup An array to store elements support.
  * @param seqDB An array of vectores with the ids of sequences where each element occur.
  * @param posDB An array of vectores with the positions where each element occur.
  * @param index The first index to look for.
  * @return True if the sequence supports some valid elements.
  */
 public boolean verifyGeneralAcceptance(
     EventSequence s,
     Vector<Element> alphabet,
     long[] sup,
     Vector<Integer>[] seqDB,
     Vector<Integer>[] posDB,
     int index) {
   boolean seqSupports = false;
   BitSet bs = new BitSet(alphabet.size());
   bs.clear();
   int from = 0;
   while (from < s.length()) {
     seqSupports = true;
     verifyContentGeneralAcceptance(
         s.elementAtIndex(from), alphabet, bs, sup, seqDB, posDB, index, from);
     from++;
   }
   return seqSupports;
 }