
#-------------------------------------------------------------------------------
# Module:     optimizeDataStruct.tk
# Activation: Dynamically loaded on user request
# Scope:      Configuration of data structures in optimization methods
#-------------------------------------------------------------------------------



proc ShowDataStructures {} {
    global WDDataStruct DefPadX

    set title "Data Structures"

    if {[RegisterFormOrWindow $title dataopt WDDataStruct ShowDataStructures \
            "Done"          {} \
            ""              {} \
            ""              {} \
            ""              {} \
        ]
    } {
        return
    }
    

    frame $WDDataStruct.heap
    label $WDDataStruct.heap.label -text "Priority Queues:" -anchor w
    radiobutton $WDDataStruct.heap.basic -text "Basic Implementation" \
        -variable goblinMethPQ -value 0 -anchor w
    radiobutton $WDDataStruct.heap.binary -text "Binary Heaps" \
        -variable goblinMethPQ -value 1 -anchor w
    radiobutton $WDDataStruct.heap.fibonacci -text "Fibonacci Heaps" \
        -variable goblinMethPQ -value 2 -anchor w
    pack $WDDataStruct.heap.label \
        $WDDataStruct.heap.basic \
        $WDDataStruct.heap.binary \
        $WDDataStruct.heap.fibonacci \
        -fill x
        
    frame $WDDataStruct.dsu
    label $WDDataStruct.dsu.label -text "Disjoint Set Union:" -anchor w
    checkbutton $WDDataStruct.dsu.enable -text "Enable Path Compression" \
        -variable goblinMethDSU -anchor w
    pack $WDDataStruct.dsu.label \
        $WDDataStruct.dsu.enable \
        -fill x
        
    frame $WDDataStruct.adjacency
    label $WDDataStruct.adjacency.label -text "Adjacencies:" -anchor w
    radiobutton $WDDataStruct.adjacency.search -text "Search Incidencies" \
        -variable goblinMethAdjacency -value 0 -anchor w
    radiobutton $WDDataStruct.adjacency.hash -text "Use Hash Table" \
        -variable goblinMethAdjacency -value 1 -anchor w
    pack $WDDataStruct.adjacency.label \
        $WDDataStruct.adjacency.search \
        $WDDataStruct.adjacency.hash \
        -fill x
     
    pack $WDDataStruct.heap $WDDataStruct.dsu $WDDataStruct.adjacency \
        -side top -fill x -pady 5m -padx $DefPadX -anchor w


    DisplayForm $title
}

ShowDataStructures
