Skip to content
Snippets Groups Projects
Commit 24e1140f authored by Iustin Pop's avatar Iustin Pop
Browse files

Remove a function in hail

This is not yet used.
parent 4333a887
No related branches found
No related tags found
No related merge requests found
......@@ -112,50 +112,6 @@ options =
"show help"
]
{- | Start computing the solution at the given depth and recurse until
we find a valid solution or we exceed the maximum depth.
-}
iterateDepth :: Cluster.Table -- ^ The starting table
-> Int -- ^ Remaining length
-> Cluster.NameList -- ^ Node idx to name list
-> Cluster.NameList -- ^ Inst idx to name list
-> Int -- ^ Max node name len
-> Int -- ^ Max instance name len
-> [[String]] -- ^ Current command list
-> Bool -- ^ Wheter to be silent
-> Cluster.Score -- ^ Score at which to stop
-> IO (Cluster.Table, [[String]]) -- ^ The resulting table and
-- commands
iterateDepth ini_tbl max_rounds ktn kti nmlen imlen
cmd_strs oneline min_score =
let Cluster.Table ini_nl ini_il ini_cv ini_plc = ini_tbl
all_inst = Container.elems ini_il
node_idx = map Node.idx . filter (not . Node.offline) $
Container.elems ini_nl
fin_tbl = Cluster.checkMove node_idx ini_tbl all_inst
(Cluster.Table _ _ fin_cv fin_plc) = fin_tbl
ini_plc_len = length ini_plc
fin_plc_len = length fin_plc
allowed_next = (max_rounds < 0 || length fin_plc < max_rounds)
in
do
let
(sol_line, cmds) = Cluster.printSolutionLine ini_il ktn
nmlen imlen (head fin_plc) fin_plc_len
upd_cmd_strs = cmds:cmd_strs
unless (oneline || fin_plc_len == ini_plc_len) $ do
putStrLn sol_line
hFlush stdout
(if fin_cv < ini_cv then -- this round made success, try deeper
if allowed_next && fin_cv > min_score
then iterateDepth fin_tbl max_rounds ktn kti
nmlen imlen upd_cmd_strs oneline min_score
-- don't go deeper, but return the better solution
else return (fin_tbl, upd_cmd_strs)
else
return (ini_tbl, cmd_strs))
-- | Formats the solution for the oneline display
formatOneline :: Double -> Int -> Double -> String
formatOneline ini_cv plc_len fin_cv =
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment