uk.ac.ic.doc.automed.tml
Class PathwayOptimiser

java.lang.Object
  extended by uk.ac.ic.doc.automed.tml.PathwayOptimiser

public class PathwayOptimiser
extends java.lang.Object


Field Summary
static int ADVANCED_ALGORITHM
           
static int BASIC_ALGORITHM
           
(package private) static java.lang.Integer MOVE_I_TO_BEFORE_J
           
(package private) static java.lang.Integer MOVE_J_TO_AFTER_I
           
 
Constructor Summary
PathwayOptimiser()
           
 
Method Summary
private static java.util.HashMap addPairToHashMapZ1()
           
private static java.util.HashMap addPairToHashMapZ2()
           
private static void changeRenameReferences(TempPathway tempP, int i, int j, java.lang.Object moveOrder)
           
private static java.util.HashMap constructHashMapA(TempPathway tempP)
           
private static java.util.HashMap constructHashMapS(TempPathway tempP)
           
private static boolean containSameSchemaObjects(java.util.Set set1, java.util.Set set2)
           
private static boolean containsObsoleteReference(java.util.HashSet set, java.lang.String str)
           
private static void dumpHashMapContents(java.util.HashMap map)
           
private static void dumpHashMapZ1Contents(java.util.HashMap map)
           
private static void dumpHashSetContents(java.util.HashSet set)
           
private static java.util.ArrayList getAllConflictingTransForReordering(TempPathway tempP, TML tml1, TML tml2, boolean needPrompt)
           
private static java.util.ArrayList getExistingKeyFromZ(java.util.HashMap map, TML tml1, TML tml2)
           
private static java.util.ArrayList getHashMapKeyForZ(TML tml1, TML tml2)
           
private static int[] getPotentiallyOptimisableActions(int action)
           
private static TempTML getSimplifiedTransformation(TML tml1, TML tml2)
           
private static java.lang.String getTranActionString(int a)
           
private static java.lang.Object isRedundant(TML tml1, TML tml2)
           
private static java.lang.Object isReorderable(TempPathway tempP, TML tml1, TML tml2, int curIndOfTml1, int curIndOfTml2, boolean returnAllConflictTrans)
           
private static boolean isSimplifiable(TML tml1, TML tml2)
           
private static java.lang.Object makeAdjacent(TempPathway tempP, int i, int j)
           
private static TempPathway optimise(TempPathway tempP, boolean removeUncertainPairs, PathwayOptimiserTool guiRef, int numOfComparisons)
           
private static TempPathway optimiseAdvancedAlgo(TempPathway tempP, boolean removeUncertainPairs, PathwayOptimiserTool guiRef)
           
static TempPathway optimisePathway(Pathway tp, boolean removeUncertainPairs, int algo)
           
static TempPathway optimisePathway(Pathway tp, boolean removeUncertainPairs, PathwayOptimiserTool guiRef, int algo)
           
static TempPathway optimisePathway(Pathway tp, int algo)
           
private static boolean performExtentsCheck(TempPathway tempP, TML tml1, TML tml2)
           
private static boolean removeKeyFromZ(java.util.HashMap map, TML tml1, TML tml2)
           
private static java.util.HashMap removePairFromHashMapZ1()
           
private static java.util.HashMap removePairFromHashMapZ2()
           
private static java.util.HashMap removeTransFromZ1(java.util.HashMap map, TML tml1, TML tml2)
           
private static void showSetContents(java.lang.String setName, java.util.Set set)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

BASIC_ALGORITHM

public static final int BASIC_ALGORITHM
See Also:
Constant Field Values

ADVANCED_ALGORITHM

public static final int ADVANCED_ALGORITHM
See Also:
Constant Field Values

MOVE_J_TO_AFTER_I

static final java.lang.Integer MOVE_J_TO_AFTER_I

MOVE_I_TO_BEFORE_J

static final java.lang.Integer MOVE_I_TO_BEFORE_J
Constructor Detail

PathwayOptimiser

public PathwayOptimiser()
Method Detail

optimisePathway

public static TempPathway optimisePathway(Pathway tp,
                                          int algo)
                                   throws IntegrityException,
                                          InconsistentException,
                                          NotFoundException,
                                          NotOptimisableException
Throws:
IntegrityException
InconsistentException
NotFoundException
NotOptimisableException

optimisePathway

public static TempPathway optimisePathway(Pathway tp,
                                          boolean removeUncertainPairs,
                                          int algo)
                                   throws IntegrityException,
                                          InconsistentException,
                                          NotFoundException,
                                          NotOptimisableException
Throws:
IntegrityException
InconsistentException
NotFoundException
NotOptimisableException

optimisePathway

public static TempPathway optimisePathway(Pathway tp,
                                          boolean removeUncertainPairs,
                                          PathwayOptimiserTool guiRef,
                                          int algo)
                                   throws IntegrityException,
                                          InconsistentException,
                                          NotFoundException,
                                          NotOptimisableException
Throws:
IntegrityException
InconsistentException
NotFoundException
NotOptimisableException

optimise

private static TempPathway optimise(TempPathway tempP,
                                    boolean removeUncertainPairs,
                                    PathwayOptimiserTool guiRef,
                                    int numOfComparisons)
                             throws IntegrityException,
                                    NotFoundException
Throws:
IntegrityException
NotFoundException

optimiseAdvancedAlgo

private static TempPathway optimiseAdvancedAlgo(TempPathway tempP,
                                                boolean removeUncertainPairs,
                                                PathwayOptimiserTool guiRef)
                                         throws NotFoundException,
                                                IntegrityException
Throws:
NotFoundException
IntegrityException

removeTransFromZ1

private static java.util.HashMap removeTransFromZ1(java.util.HashMap map,
                                                   TML tml1,
                                                   TML tml2)

removeKeyFromZ

private static boolean removeKeyFromZ(java.util.HashMap map,
                                      TML tml1,
                                      TML tml2)

getExistingKeyFromZ

private static java.util.ArrayList getExistingKeyFromZ(java.util.HashMap map,
                                                       TML tml1,
                                                       TML tml2)

getHashMapKeyForZ

private static java.util.ArrayList getHashMapKeyForZ(TML tml1,
                                                     TML tml2)

getAllConflictingTransForReordering

private static java.util.ArrayList getAllConflictingTransForReordering(TempPathway tempP,
                                                                       TML tml1,
                                                                       TML tml2,
                                                                       boolean needPrompt)
                                                                throws IntegrityException
Throws:
IntegrityException

performExtentsCheck

private static boolean performExtentsCheck(TempPathway tempP,
                                           TML tml1,
                                           TML tml2)

getPotentiallyOptimisableActions

private static int[] getPotentiallyOptimisableActions(int action)

constructHashMapA

private static java.util.HashMap constructHashMapA(TempPathway tempP)

constructHashMapS

private static java.util.HashMap constructHashMapS(TempPathway tempP)

addPairToHashMapZ1

private static java.util.HashMap addPairToHashMapZ1()

removePairFromHashMapZ1

private static java.util.HashMap removePairFromHashMapZ1()

addPairToHashMapZ2

private static java.util.HashMap addPairToHashMapZ2()

removePairFromHashMapZ2

private static java.util.HashMap removePairFromHashMapZ2()

dumpHashMapContents

private static void dumpHashMapContents(java.util.HashMap map)

dumpHashMapZ1Contents

private static void dumpHashMapZ1Contents(java.util.HashMap map)

getTranActionString

private static java.lang.String getTranActionString(int a)

dumpHashSetContents

private static void dumpHashSetContents(java.util.HashSet set)

makeAdjacent

private static java.lang.Object makeAdjacent(TempPathway tempP,
                                             int i,
                                             int j)
                                      throws IntegrityException,
                                             NotFoundException
Throws:
IntegrityException
NotFoundException

changeRenameReferences

private static void changeRenameReferences(TempPathway tempP,
                                           int i,
                                           int j,
                                           java.lang.Object moveOrder)

containsObsoleteReference

private static boolean containsObsoleteReference(java.util.HashSet set,
                                                 java.lang.String str)

isRedundant

private static java.lang.Object isRedundant(TML tml1,
                                            TML tml2)
                                     throws NotFoundException
Throws:
NotFoundException

containSameSchemaObjects

private static boolean containSameSchemaObjects(java.util.Set set1,
                                                java.util.Set set2)
                                         throws NotFoundException
Throws:
NotFoundException

isSimplifiable

private static boolean isSimplifiable(TML tml1,
                                      TML tml2)
                               throws NotFoundException
Throws:
NotFoundException

showSetContents

private static void showSetContents(java.lang.String setName,
                                    java.util.Set set)

isReorderable

private static java.lang.Object isReorderable(TempPathway tempP,
                                              TML tml1,
                                              TML tml2,
                                              int curIndOfTml1,
                                              int curIndOfTml2,
                                              boolean returnAllConflictTrans)
                                       throws IntegrityException
Throws:
IntegrityException

getSimplifiedTransformation

private static TempTML getSimplifiedTransformation(TML tml1,
                                                   TML tml2)
                                            throws NotFoundException,
                                                   IntegrityException,
                                                   InconsistentException
Throws:
NotFoundException
IntegrityException
InconsistentException