Skip to content

Commit

Permalink
Update tex
Browse files Browse the repository at this point in the history
  • Loading branch information
jakubkottnauer committed Apr 26, 2016
1 parent f5bd628 commit 8b1aeb0
Show file tree
Hide file tree
Showing 12 changed files with 649 additions and 248 deletions.
7 changes: 5 additions & 2 deletions DomainTypes.fs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ module DomainTypes =

let private DIVISOR_ZERO = "Divisor must not be zero."
let private VAR_INVALID = "Invalid variable."
let ZERO_EPSILON = 0.00000000000000000000000000000000001
let ZERO_EPSILON = 0.0000000000000000000000000000001

/// An interval
///
Expand Down Expand Up @@ -331,10 +331,13 @@ module DomainTypes =
member this.AllFraction eps =
mainVars |> List.forall(fun item -> (item.Domain.Length / item.OriginalDomain.Length) < eps)

/// Calculate the volume of the box created by the dominant variables in this problem.
/// Calculate the volume of the box formed by the dominant variables in this problem.
member this.Volume =
mainVars |> List.fold (fun acc item -> item.Domain.Length * acc) 1.0

/// Calculate the original volume of the box formed by the dominant variables in this problem.
member this.OriginalVolume =
mainVars |> List.fold (fun acc item -> item.OriginalDomain.Length * acc) 1.0

/// Splits the problem into two halves by halving the chosen variable's domain.
member this.Split =
Expand Down
11 changes: 6 additions & 5 deletions Program.fs
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ module Main =
|> parseCommandLineRec xs

| x::xs ->
printfn "Option '%s' is unrecognized" x
printfn "Option '%s' is unrecognized." x
parseCommandLineRec xs optionsSoFar

let parseCommandLine args =
Expand All @@ -145,10 +145,11 @@ module Main =
let options = parseCommandLine (args |> List.ofArray)

// let options = {
// fileName = "C:\\git\\hull-solver\\tests\\solotarev";
// eps = 0.0001;
// fileName = "C:\\git\\hull-solver\\tests\\wright";
// eps = 0.01;
// heuristic = Heuristics.MinRightCand;
// heuristicName = "max-right-cand";
// heuristicName = "min-right-cand";
// latex = false
// }

let constraints, variables =
Expand All @@ -160,6 +161,6 @@ module Main =
|> Solver.solve options
|> ignore

// Console.ReadKey()
// Console.ReadKey()

0
19 changes: 13 additions & 6 deletions Solver.fs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@ module Solver =
let MAX_ITERATIONS = 1000
let mutable private ind_halving_count = 0
let mutable private ind_narrowing_count = 0
let mutable private ind_solution_volume = 0.0
let mutable private smallest_solution = 10000.0

/// Removes element from a list at the specified index.
/// <param name="i">The index of the element to be removed.</param>
Expand Down Expand Up @@ -89,9 +91,13 @@ module Solver =

else
let reducedProblem = hc3 options p
if reducedProblem.HasSolution && not options.latex then
printfn "Volume of solution box: %.32f" reducedProblem.Volume
reducedProblem.Print
if reducedProblem.HasSolution then
if smallest_solution > reducedProblem.Volume then
smallest_solution <- reducedProblem.Volume
ind_solution_volume <- reducedProblem.Volume / reducedProblem.OriginalVolume
if not options.latex then
printfn "Volume of solution box: %.32f" reducedProblem.Volume
reducedProblem.Print

let printResults options (p : Problem) runtime =
match options.latex with
Expand All @@ -101,15 +107,16 @@ module Solver =
printfn "File: %s" options.fileName
printfn "Number of narrowings: %i" ind_narrowing_count
printfn "Number of solution halving: %i" ind_halving_count
printfn "Original volume: %.32f" p.Volume
printfn "Original volume: %.32f" p.OriginalVolume
printfn "Duration (s): %.32f" runtime
printfn "---------"
| true ->
printf "%s" options.fileName.[6..]
printf " & %i" ind_halving_count
printf " & %i" ind_narrowing_count
printf " & %.5f" runtime
printfn " & \\\\"
printf " & %.4g" ind_solution_volume
printf " & %.4f" runtime
printfn " \\\\"

/// Entry function of the solver.
let solve options (p : Problem) =
Expand Down
10 changes: 5 additions & 5 deletions run.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,17 +10,17 @@ SET "eps=0.001"
if not exist %outputFolder% mkdir %outputFolder%

>> %output% (
echo \begin{table}[]
echo \begin{table}[H]
echo \centering
echo \label{!heuristicName!}
echo \begin{tabular}{lllll}
echo \begin{tabular}{lrrrr}
echo \hline
echo Testovací soubor ^& Poèet rozpùlení intervalu ^& Poèet zúžení intervalù ^& Èas ^& \\ \hline
echo problém ^& \# pùlení ^& \# zúžení ^& pomìr objemu ^& èas (s^) \\ \hline

for %%i in (%testsFolder%\*) do bin\Debug\HullSolver.exe -f %%i -h %heuristicName% -p %eps% -l

echo \end{tabular}
echo \caption{!heuristicName!}
echo \caption{Výsledky pro heuristiku \emph{!heuristicName!}}
echo \label{!heuristicName!}
echo \end{table}
echo.
echo.
Expand Down
58 changes: 58 additions & 0 deletions tests/wright
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
// http://homepages.math.uic.edu/~jan/Demo/wright.html

x1 x2 x3 x4 x5

x1 * x1 = x1_2
x2 * x2 = x2_2
x3 * x3 = x3_2
x4 * x4 = x4_2
x5 * x5 = x5_2
x1_2 - x1 = i1
x2_2 + x1 = i2
x3_2 + x1 = i3
x4_2 + x1 = i4
x5_2 + x1 = i5
x2 + x3 = j1
x3 - x2 = j2
x2 - x3 = j3
i1 + j1 = k1
i2 + j2 = k2
i3 + j3 = k3
i4 + j1 = k4
i5 + j1 = k5
x4 + x5 = l1
x5 - x4 = l2
x4 - x5 = l3
k1 + l1 = a
k2 + l1 = a
k3 + l1 = a
k4 + l2 = a
k5 + l3 = a

a in [10,10]
x1 in [-1000,1000]
x3 in [-1000,1000]
x2 in [-1000,1000]
x4 in [-1000,1000]
x5 in [-1000,1000]
x1_2 in [-1000,1000]
x2_2 in [-1000,1000]
x3_2 in [-1000,1000]
x4_2 in [-1000,1000]
x5_2 in [-1000,1000]
i1 in [-100,100]
i2 in [-100,100]
i3 in [-100,100]
i4 in [-100,100]
i5 in [-100,100]
j1 in [-100,100]
j2 in [-100,100]
j3 in [-100,100]
k1 in [-100,100]
k2 in [-100,100]
k3 in [-100,100]
k4 in [-100,100]
k5 in [-100,100]
l1 in [-100,100]
l2 in [-100,100]
l3 in [-100,100]
8 changes: 6 additions & 2 deletions tex/FITthesis.cls
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@
\newif\if@declarationOptionSelected
\DeclareRobustCommand{\declarationOfAuthenticityOption}[1]{
\ifx1#1 \DeclareRobustCommand{\thedeclarationofauthenticity}{\if\@lang1{%
Prohla\v suji, \v ze jsem p\v redlo\v zenou pr\'aci vypracoval(a) samostatn\v e a \v ze jsem uvedl(a) ve\v sker\'e pou\v zit\'e informa\v cn\'\i{} zdroje v~souladu s~Metodick\'ym pokynem o~etick\'e p\v r\'\i{}prav\v e vysoko\v skolsk\'ych z\'av\v ere\v cn\'ych prac\'\i{}.
Prohla\v suji, \v ze jsem p\v redlo\v zenou pr\'aci vypracoval(a) samostatn\v e a \v ze jsem uvedl ve\v sker\'e pou\v zit\'e informa\v cn\'\i{} zdroje v~souladu s~Metodick\'ym pokynem o~etick\'e p\v r\'\i{}prav\v e vysoko\v skolsk\'ych z\'av\v ere\v cn\'ych prac\'\i{}.

Beru na v\v edom\'\i{}, \v ze se na moji pr\'aci vztahuj\'\i{} pr\'ava a povinnosti vypl\'yvaj\'\i{}c\'\i{} ze z\'akona \v c.~121/2000~Sb., autorsk\'eho z\'akona, ve zn\v en\'\i{} pozd\v ej\v s\'\i{}ch p\v redpis{\r u}, zejm\'ena skute\v cnost, \v ze \v Cesk\'e vysok\'e u\v cen\'\i{} technick\'e v~Praze m\'a pr\'avo na uzav\v ren\'\i{} licen\v cn\'\i{} smlouvy o~u\v zit\'\i{} t\'eto pr\'ace jako \v skoln\'\i{}ho d\'\i{}la podle \S{}~60 odst.~1 autorsk\'eho z\'akona.
}\else\if\@lang2{%
Expand Down Expand Up @@ -217,7 +217,7 @@ sp\^ osobom, ktor\'y nezni\v zuje hodnotu Diela, ale len pre~nez\'arobkov\'e \'u
}\fi\fi
}\@declarationOptionSelectedtrue\fi
\ifx4#1 \DeclareRobustCommand{\thedeclarationofauthenticity}{\if\@lang1{%
Prohla\v suji, \v ze jsem p\v redlo\v zenou pr\'aci vypracoval(a) samostatn\v e a \v ze jsem uvedl(a) ve\v sker\'e pou\v zit\'e informa\v cn\'\i{} zdroje v~souladu s~Metodick\'ym pokynem o~etick\'e p\v r\'\i{}prav\v e vysoko\v skolsk\'ych z\'av\v ere\v cn\'ych prac\'\i{}.
Prohla\v suji, \v ze jsem p\v redlo\v zenou pr\'aci vypracoval samostatn\v e a \v ze jsem uvedl ve\v sker\'e pou\v zit\'e informa\v cn\'\i{} zdroje v~souladu s~Metodick\'ym pokynem o~etick\'e p\v r\'\i{}prav\v e vysoko\v skolsk\'ych z\'av\v ere\v cn\'ych prac\'\i{}.

Beru na v\v edom\'\i{}, \v ze se na moji pr\'aci vztahuj\'\i{} pr\'ava a povinnosti vypl\'yvaj\'\i{}c\'\i{} ze z\'akona \v c.~121/2000~Sb., autorsk\'eho z\'akona, ve zn\v en\'\i{} pozd\v ej\v s\'\i{}ch p\v redpis{\r u}. V~souladu s~ust. \S{}~46 odst.~6 tohoto z\'akona t\'\i{}mto ud\v eluji nev\'yhradn\'\i{} opr\'avn\v en\'\i{} (licenci) k~u\v zit\'\i{} t\'eto moj\'\i{} pr\'ace, a to v\v cetn\v e v\v sech po\v c\'\i{}ta\v cov\'ych program{\r u}, je\v z jsou jej\'\i{} sou\v c\'ast\'\i{} \v ci p\v r\'\i{}lohou, a ve\v sker\'e jejich dokumentace (d\'ale souhrnn\v e jen \uv{D\'\i{}lo}), a to v\v sem osob\'am, kter\'e si p\v rej\'\i{} D\'\i{}lo u\v z\'\i{}t. Tyto osoby jsou opr\'avn\v eny D\'\i{}lo u\v z\'\i{}t jak\'ymkoli zp{\r u}sobem, kter\'y nesni\v zuje hodnotu D\'\i{}la, a za jak\'ymkoli \'u\v celem (v\v cetn\v e u\v zit\'\i{} k~v\'yd\v ele\v cn\'ym \'u\v cel{\r u}m). Toto opr\'avn\v en\'\i{} je \v casov\v e, teritori\'aln\v e i~mno\v zstevn\v e neomezen\'e. Ka\v zd\'a osoba, kter\'a vyu\v zije v\'y\v se
uvedenou licenci, se v\v sak zavazuje ud\v elit ke ka\v zd\'emu d\'\i{}lu, kter\'e vznikne (by\v t jen z\v c\'asti) na z\'aklad\v e D\'\i{}la, \'upravou D\'\i{}la, spojen\'\i{}m D\'\i{}la s~jin\'ym d\'\i{}lem, za\v razen\'\i{}m D\'\i{}la do d\'\i{}la souborn\'eho \v ci zpracov\'an\'\i{}m D\'\i{}la (v\v cetn\v e p\v rekladu), licenci alespo\v n ve v\'y\v se uveden\'em rozsahu a z\'arove\v n zp\v r\'\i{}stupnit zdrojov\'y k\'od takov\'eho d\'\i{}la alespo\v n srovnateln\'ym zp{\r u}sobem a ve srovnateln\'em rozsahu, jako je zp\v r\'\i{}stupn\v en zdrojov\'y k\'od D\'\i{}la.
Expand Down Expand Up @@ -464,6 +464,10 @@ sp\^ osobom, ktor\'y nezni\v zuje hodnotu Diela (vr\'atane komer\v cn\'eho vyu\v
\cleardoublepage
\listoftablescond

\renewcommand{\listalgorithmname}{Seznam algoritm\r u}
\cleardoublepage
\listofalgorithms

\pagestyle{ruled}
\mainmatter
}
51 changes: 45 additions & 6 deletions tex/bib.bib
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,19 @@ @ARTICLE{Benhamou97applyinginterval
}

@techreport{BenhamouCLPIntervals,
author = {Benhamou, F. and McAllester, D. and Van Hentenryck, P.},
title = {CLP (Intervals) Revisited},
author = {Benhamou, F. and McAllester, D. and van Hentenryck, P.},
title = {CLP(Intervals) Revisited},
booktitle = {Proceedings of the 1994 International Symposium on Logic Programming},
series = {ILPS '94},
year = {1994},
source = {http://www.ncstrl.org:8900/ncstrl/servlet/search?formname=detail\&id=oai%3Ancstrlh%3Abrowncs%3ABrownCS%2F%2FCS-94-18},
publisher = {Brown University},
address = {Providence, RI, USA},
isbn = {0-262-52191-1},
location = {Symposia, Melbourne},
pages = {124--138},
numpages = {15},
url = {http://dl.acm.org/citation.cfm?id=200616.200634},
acmid = {200634},
publisher = {MIT Press},
address = {Cambridge, MA, USA},
}

@book{feiten10,
Expand Down Expand Up @@ -168,4 +175,36 @@ @INPROCEEDINGS{rueherDependency
location = {Limoges, FR},
ISBN = {2-914256-07-8},
url = {http://users.polytech.unice.fr/~rueher/Publis/3ia_rueher.pdf}
}
}

@Inbook{silaghi2001,
author="Silaghi, Marius-C{\u{A}}lin
and Sam-Haroud, Djamila
and Faltings, Boi",
editor="Stroulia, Eleni
and Matwin, Stan",
chapter="Search Techniques for Non-Linear Constraint Satisfaction Problems with Inequalities",
title="Advances in Artificial Intelligence: 14th Biennial Conference of the Canadian Society for Computational Studies of Intelligence, AI 2001 Ottawa, Canada, June 7--9, 2001 Proceedings",
year="2001",
publisher="Springer Berlin Heidelberg",
address="Berlin, Heidelberg",
pages="183--193",
isbn="978-3-540-45153-2",
doi="10.1007/3-540-45153-6_18",
url="http://dx.doi.org/10.1007/3-540-45153-6_18"
}

@Book{Moore:09,
author = {Ramon E. Moore and R. Baker Kearfott and Michael J. Cloud},
title = {Introduction to Interval Analysis},
publisher = {SIAM},
year = 2009}

@book{Russell:2003,
author = {Russell, Stuart J. and Norvig, Peter},
title = {Artificial Intelligence: A Modern Approach},
year = {2003},
isbn = {0137903952},
edition = {2},
publisher = {Pearson Education},
}
Loading

0 comments on commit 8b1aeb0

Please sign in to comment.