src/main/java/Alergia.java
private void runMainAlergiaLoop() {
        double start = System.currentTimeMillis();

        List<FptaNode> red = new ArrayList<>();
        red.add(mutableTree);
        List<FptaNode> blue = new ArrayList<>(mutableTree.getSuccessors());

        while (!blue.isEmpty()){
            FptaNode lexMinBlue = getLexMin(blue);
            boolean merged = false;

            for (FptaNode r : red){
                if(compatibilityTest(getNodeFromT(r), getNodeFromT(lexMinBlue))){
                    merge(r, lexMinBlue);
                    merged = true;
                    break;
                }
            }

            if(!merged)
                insertInLexMinSort(red, lexMinBlue);

            blue.clear();

            for(FptaNode r:red){
                for (FptaNode s : r.getSuccessors()){
                    if(!red.contains(s))
                        blue.add(s);
                }
            }

        }

        normalize(red);
        Parser.saveModel(red, modelType, saveLocation);
        double timeElapsed = System.currentTimeMillis() - start;
        System.out.println("Alergia learning time    : " + String.format("%.2f", timeElapsed / 1000) + " seconds.");
        System.out.println("Alergia learned " + red.size() + " state automaton.");
    }
/**
     * Runs the main loop of the algorithm.
     */
Runs the main loop of the algorithm.
Runs the main loop of the algorithm .
private void runMainAlergiaLoop() {
        double start = System.currentTimeMillis();
        List<FptaNode> red = new ArrayList<>();
        red.add(mutableTree);
        List<FptaNode> blue = new ArrayList<>(mutableTree.getSuccessors());
        while (!blue.isEmpty()){
            FptaNode lexMinBlue = getLexMin(blue);
            boolean merged = false;
            for (FptaNode r : red){
                if(compatibilityTest(getNodeFromT(r), getNodeFromT(lexMinBlue))){
                    merge(r, lexMinBlue);
                    merged = true;
                    break;
                }
            }
            if(!merged)
                insertInLexMinSort(red, lexMinBlue);
            blue.clear();
            for(FptaNode r:red){
                for (FptaNode s : r.getSuccessors()){
                    if(!red.contains(s))
                        blue.add(s);
                }
            }
        }
        normalize(red);
        Parser.saveModel(red, modelType, saveLocation);
        double timeElapsed = System.currentTimeMillis() - start;
        System.out.println("Alergia learning time    : " + String.format("%.2f", timeElapsed / 1000) + " seconds.");
        System.out.println("Alergia learned " + red.size() + " state automaton.");
    }
private void runMainAlergiaLoop ( ) { double start = System . currentTimeMillis ( ) ; List < FptaNode > red = new ArrayList < > ( ) ; red . add ( mutableTree ) ; List < FptaNode > blue = new ArrayList < > ( mutableTree . getSuccessors ( ) ) ; while ( ! blue . isEmpty ( ) ) { FptaNode lexMinBlue = getLexMin ( blue ) ; boolean merged = false ; for ( FptaNode r : red ) { if ( compatibilityTest ( getNodeFromT ( r ) , getNodeFromT ( lexMinBlue ) ) ) { merge ( r , lexMinBlue ) ; merged = true ; break ; } } if ( ! merged ) insertInLexMinSort ( red , lexMinBlue ) ; blue . clear ( ) ; for ( FptaNode r : red ) { for ( FptaNode s : r . getSuccessors ( ) ) { if ( ! red . contains ( s ) ) blue . add ( s ) ; } } } normalize ( red ) ; Parser . saveModel ( red , modelType , saveLocation ) ; double timeElapsed = System . currentTimeMillis ( ) - start ; System . out . println ( "Alergia learning time    : " + String . format ( "%.2f" , timeElapsed / 1000 ) + " seconds." ) ; System . out . println ( "Alergia learned " + red . size ( ) + " state automaton." ) ; }
Runs the main loop of the algorithm.
Runs the main loop of the algorithm .