Commit bb597a06 authored by Arthur Bit-Monnot's avatar Arthur Bit-Monnot

Warmup JVM before running the benchmark and force GC after each run.

parent a23efeeb
......@@ -14,6 +14,11 @@ object RCLL extends App {
val TIMEOUT = 60.seconds
dahu.utils.debug.LOG_LEVEL = 2
// warmup
solve(new File("out/rcll.dom.pddl"), new File(s"out/rcll.001-R1-C0.pb.pddl"), false, a => 3)
solve(new File("out/rcll.dom.pddl"), new File(s"out/rcll.001-R1-C0.pb.pddl"), false, a => 3)
solve(new File("out/rcll.dom.pddl"), new File(s"out/rcll.001-R1-C0.pb.pddl"), false, a => 3)
for(game <- 1 to 20; c <- 0 to 1; r <- 1 to 3; spec <- Seq(false, true)) {
val pbName = f"$game%03d-R$r-C$c"
......@@ -53,18 +58,19 @@ object RCLL extends App {
val startTime = System.currentTimeMillis().millis
val result = solve(domain, problem, spec, a => maxActions(a.name))
val duration = RCLLAnalysis.format(System.currentTimeMillis().millis - startTime)
System.gc()
val status = result match {
case Some(plan) => "OK"
case None => "__"
}
println(pbName + (if(spec) "\tspec" else "\tgen") + s"\t$status\t$duration")
println(pbName + (if(spec) "\tspe" else "\tgen") + s"\t$status\t$duration")
}
def solve(domain: File,
problem: File,
specialized: Boolean,
numAction: ActionTemplate => Int): Option[Plan] = {
numAction: ActionTemplate => Int): Option[PddlPlan] = {
val pddlOptions = Options(discretization = DISCRETIZATIOn)
val parser = new Parser(pddlOptions)
......@@ -74,9 +80,11 @@ object RCLL extends App {
parser.parse(domain, problem) match {
case Success(model) =>
if(specialized) {
Planner.solveWithGivenActionNumbers(model, numAction, Deadline.now + TIMEOUT)
Planner
.solveWithGivenActionNumbers(model, numAction, Deadline.now + TIMEOUT)
.map(PddlPlan(_))
} else {
Planner.solveIncremental(model, 15, Deadline.now + TIMEOUT)
Planner.solveIncremental(model, 15, Deadline.now + TIMEOUT).map(PddlPlan(_))
}
case Failure(err) =>
err.printStackTrace()
......@@ -84,36 +92,3 @@ object RCLL extends App {
}
}
}
//0.001: (prepare-bs c-bs, input, base_red) [0.0]
//0.001: (enter-field r-1, cyan) [10.0]
//0.103: (bs-dispense c-bs, input, wp1, base_red) [0.0]
//10.004: (move-wp-get r-1, start, input, c-bs, input) [2.831]
//12.836: (wp-get r-1, wp1, c-bs, input) [5.0]
//17.838: (move-wp-put-at-input r-1, c-bs, input, c-rs1) [1.514]
//19.354: (prepare-rs r-1, c-rs1, ring_yellow, zero, zero, zero) [0.0]
//19.355: (wp-put r-1, wp1, c-rs1) [5.0]
//19.356: (move-wp-put-at-input r-1, c-rs1, input, c-cs1) [9.597]
//28.954: (wp-get-shelf r-1, cg1, c-cs1, left) [5.0]
//28.956: (prepare-cs r-1, c-cs1, cs_retrieve) [0.0]
//33.955: (wp-discard r-1, cg1) [0.0]
//33.956: (wp-get-shelf r-1, cg3, c-cs1, right) [5.0]
//38.957: (wp-put r-1, cg3, c-cs1) [5.0]
//43.958: (cs-retrieve-cap c-cs1, cg3, cap_grey) [0.1]
//44.059: (rs-mount-ring1 c-rs1, wp1, ring_yellow, zero, zero, zero) [0.1]
//44.059: (move-wp-get r-1, c-cs1, input, c-cs1, output) [2.809]
//46.869: (wp-get r-1, cg3, c-cs1, output) [5.0]
//51.87: (wp-discard r-1, cg3) [0.0]
//51.871: (move-wp-get r-1, c-cs1, output, c-rs1, output) [12.613]
//64.485: (wp-get r-1, wp1, c-rs1, output) [5.0]
//64.486: (move-wp-put-at-input r-1, c-rs1, output, c-cs1) [10.932]
//75.419: (prepare-cs r-1, c-cs1, cs_mount) [0.0]
//75.421: (wp-put r-1, wp1, c-cs1) [5.0]
//80.422: (wp-get-shelf r-1, cg2, c-cs1, middle) [5.0]
//85.423: (wp-discard r-1, cg2) [0.0]
//85.426: (cs-mount-cap c-cs1, wp1, cap_grey) [0.1]
//85.527: (move-wp-get r-1, c-cs1, input, c-cs1, output) [2.809]
//88.337: (wp-get r-1, wp1, c-cs1, output) [5.0]
//88.338: (move-wp-put-at-input r-1, c-cs1, output, c-ds) [9.077]
//97.416: (prepare-ds r-1, c-ds, gate-2) [0.0]
//98.342: (wp-put r-1, wp1, c-ds) [5.0]
//103.347: (fulfill-order-c1 o1, wp1, c-ds, gate-2, base_red, cap_grey, ring_yellow) [0.0]
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment