Changeset 1968 for trunk/autoquest-core-tasktrees/src/main/java/de/ugoe
- Timestamp:
- 06/16/15 10:12:36 (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/autoquest-core-tasktrees/src/main/java/de/ugoe/cs/autoquest/tasktrees/temporalrelation/utils/MostSimilarTaskDeterminer.java
r1966 r1968 25 25 26 26 import de.ugoe.cs.autoquest.tasktrees.temporalrelation.TaskComparator; 27 import de.ugoe.cs.autoquest.tasktrees.treeifc.DefaultTaskInstanceTraversingVisitor; 27 28 import de.ugoe.cs.autoquest.tasktrees.treeifc.DefaultTaskTraversingVisitor; 28 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.IEventTaskInstance; 29 import de.ugoe.cs.autoquest.tasktrees.treeifc.IOptionalInstance;30 import de.ugoe.cs.autoquest.tasktrees.treeifc.ISelectionInstance;31 30 import de.ugoe.cs.autoquest.tasktrees.treeifc.IStructuringTemporalRelationship; 32 31 import de.ugoe.cs.autoquest.tasktrees.treeifc.ITask; … … 818 817 long timestamp = Long.MAX_VALUE; 819 818 819 final List<IEventTaskInstance> eventTaskInstances = new LinkedList<>(); 820 820 for (ITaskInstance instance : task.getInstances()) { 821 ITaskInstance eventTaskInstance = instance; 822 823 do { 824 if (eventTaskInstance instanceof ITaskInstanceList) { 825 eventTaskInstance = ((ITaskInstanceList) eventTaskInstance).get(0); 826 } 827 else if (eventTaskInstance instanceof ISelectionInstance) { 828 eventTaskInstance = ((ISelectionInstance) eventTaskInstance).getChild(); 829 } 830 else if (eventTaskInstance instanceof IOptionalInstance) { 831 eventTaskInstance = ((IOptionalInstance) eventTaskInstance).getChild(); 832 } 833 } 834 while (!(eventTaskInstance instanceof IEventTaskInstance)); 835 836 if (eventTaskInstance != null) { 821 eventTaskInstances.clear(); 822 823 instance.accept(new DefaultTaskInstanceTraversingVisitor() { 824 825 @Override 826 public void visit(IEventTaskInstance eventTaskInstance) { 827 eventTaskInstances.add(eventTaskInstance); 828 } 829 830 @Override 831 public void visit(ITaskInstanceList taskInstanceList) { 832 for (ITaskInstance child : taskInstanceList) { 833 if (eventTaskInstances.size() > 0) { 834 break; 835 } 836 837 child.accept(this); 838 } 839 } 840 841 }); 842 843 if (eventTaskInstances.size() > 0) { 837 844 long newTimestamp = 838 ((IEventTaskInstance) eventTaskInstance ).getEvent().getTimestamp();845 ((IEventTaskInstance) eventTaskInstances.get(0)).getEvent().getTimestamp(); 839 846 840 847 if (timestamp > newTimestamp) {
Note: See TracChangeset
for help on using the changeset viewer.