Ignore:
Timestamp:
09/05/14 20:20:29 (10 years ago)
Author:
rkrimmel
Message:

Added automatically created javadoc, still needs to be commented properly though

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/autoquest-core-tasktrees-alignment/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/RuleUtils.java

    r1733 r1734  
    2828import de.ugoe.cs.autoquest.tasktrees.treeifc.ITaskFactory; 
    2929 
     30 
    3031/** 
    3132 * <p> 
    3233 * provides some convenience methods for rule application 
    33  * </p> 
    34  *  
     34 * </p>. 
     35 * 
    3536 * @author Patrick Harms 
    3637 */ 
     
    4142         * replaces a sub sequence for a specified range of elements in the provided 
    4243         * task instances list by a sub task instance 
    43          * </p> 
    44          * 
    45          * @param parent 
    46          *            the list of which the range shall be replaced 
    47          * @param startIndex 
    48          *            the start index of the range 
    49          * @param endIndex 
    50          *            the end index of the range (inclusive) 
    51          * @param model 
    52          *            the task model (required for instantiating the sub sequence) 
    53          * @param taskFactory 
    54          *            the task factory used for instantiating the sub sequence 
    55          * @param taskBuilder 
    56          *            the task builder to perform changes in the task structure 
    57          *  
     44         * </p>. 
     45         * 
     46         * @param parent            the list of which the range shall be replaced 
     47         * @param startIndex            the start index of the range 
     48         * @param endIndex            the end index of the range (inclusive) 
     49         * @param model            the task model (required for instantiating the sub sequence) 
     50         * @param taskFactory            the task factory used for instantiating the sub sequence 
     51         * @param taskBuilder            the task builder to perform changes in the task structure 
    5852         * @return the replacement for the range 
    59          * @throws 
    6053         */ 
    6154        static ISequenceInstance createNewSubSequenceInRange( 
     
    6558                                .createNewTaskInstance(model); 
    6659 
    67                 // TODO: Debug output 
    68                 /* 
    69                  * System.out.println("PRINTING MODEL: "); for (int i = 0; i < 
    70                  * subsequence.getSequence().getChildren().size(); i++) { 
    71                  * System.out.println(subsequence.getSequence().getChildren().get(i)); 
    72                  *  
    73                  * if (subsequence.getSequence().getChildren().get(i).getType() == 
    74                  * "selection") { for (int j = 0; j < ((ISelection) 
    75                  * subsequence.getSequence().getChildren().get(i)) 
    76                  * .getChildren().size(); j++) { if(((IStructuringTemporalRelationship) 
    77                  * subsequence 
    78                  * .getSequence().getChildren().get(i)).getChildren().get(j).getType() 
    79                  * =="sequence") { ISequence foo = (ISequence) ((ISelection) 
    80                  * (subsequence 
    81                  * .getSequence().getChildren().get(i))).getChildren().get(j); 
    82                  * System.out.println("\t" + foo); for(int k=0; k< 
    83                  * foo.getChildren().size();k++) { System.out.println("\t\t" 
    84                  * +foo.getChildren().get(k)); } System.out.println(); } else{ 
    85                  * System.out.println("\t" + ((ISelection) 
    86                  * subsequence.getSequence().getChildren().get(i)) 
    87                  * .getChildren().get(j)); } 
    88                  *  
    89                  * } } 
    90                  *  
    91                  * } System.out.println(); 
    92                  */ 
    93  
    94                 // TODO: This is dirty! 
     60                 
     61                // TODO: This is dirty, return this in addition with the sequence instance instead 
    9562                missedOptionals = 0; 
    9663                int modelindex = 0; 
     
    144111                                                        || (parent.get(startIndex).getTask().getId() == tmpSel 
    145112                                                                        .getChildren().get(1).getId())) { 
    146                                                 // System.out.println("Session ID: " + 
    147                                                 // parent.get(startIndex).getTask().getId() + 
    148                                                 // " tmpSel(0): " + tmpSel.getChildren().get(0).getId() 
    149                                                 // + " tmpSel(1): " +tmpSel.getChildren().get(1).getId() 
    150                                                 // ); 
    151113                                                continue; 
    152114                                        } 
     
    154116                                        for (int k = 0; k < selseq.getSequence().getChildren() 
    155117                                                        .size(); k++) { 
    156                                                 // System.out.println("Trying to add " + 
    157                                                 // parent.get(startIndex) + " to " + selseq); 
    158118                                                taskBuilder.addChild(selseq, parent.get(startIndex)); 
    159119                                                taskBuilder.removeTaskInstance(parent, startIndex); 
    160120                                                i++; 
    161                                                 // System.out.println("I:" + i); 
    162121                                        } 
    163                                         // System.out.println("Trying to add " + selseq + " to " + 
    164                                         // tmpSel); 
    165122                                        taskBuilder.setChild(selection, selseq); 
    166123                                        taskBuilder.addChild(subsequence, selection); 
     
    168125                                        continue; 
    169126                                } else { 
    170                                         // System.out.println("Trying to adding SelectionInstance " 
    171                                         // + parent.get(startIndex) + " to " + tempTask); 
    172127                                        taskBuilder.setChild(selection, parent.get(startIndex)); 
    173128                                        taskBuilder.addChild(subsequence, selection); 
    174129                                } 
    175130                        } else if (tempTask.getType() == "sequence") { 
    176                                 // System.out.println("Adding SequenceInstance " + 
    177                                 // parent.get(startIndex) + " to " + tempTask); 
    178131                                taskBuilder.addChild(subsequence, parent.get(startIndex)); 
    179132                        } else if (tempTask.getType() == "iteration") { 
    180                                 // System.out.println("Adding IterationInstance " + 
    181                                 // parent.get(startIndex) + " to " + tempTask); 
    182133                                taskBuilder.addChild(subsequence, parent.get(startIndex)); 
    183134                        } else { 
    184                                 // System.out.println("Adding EventInstance " + 
    185                                 // parent.get(startIndex) + " to " + tempTask); 
    186                                 // System.out.println("Foo"); 
    187135                                taskBuilder.addChild(subsequence, parent.get(startIndex)); 
    188136                        } 
     
    199147         * <p> 
    200148         * returns the next available id (uses the id counter) 
    201          * </p> 
    202          *  
     149         * </p>. 
     150         * 
    203151         * @return the next available id 
    204152         */ 
     
    241189        } 
    242190 
    243         // Print out the progress 
     191        /** 
     192         * Prints the progress percentage. 
     193         * 
     194         * @param message the message 
     195         * @param count the count 
     196         * @param size the size 
     197         */ 
    244198        static void printProgressPercentage(String message, int count, int size) { 
    245199                if (size > 100) { 
     
    270224        private static int idCounter = 0; 
    271225 
     226        /** The missed optionals. */ 
    272227        public static int missedOptionals = 0; 
    273228 
     
    275230         * <p> 
    276231         * prevent instantiation 
    277          * </p> 
     232         * </p>. 
    278233         */ 
    279234        private RuleUtils() { 
Note: See TracChangeset for help on using the changeset viewer.