[Toss-devel-svn] SF.net SVN: toss:[1290] trunk/Toss
Status: Beta
Brought to you by:
lukaszkaiser
|
From: <luk...@us...> - 2011-01-30 02:54:06
|
Revision: 1290
http://toss.svn.sourceforge.net/toss/?rev=1290&view=rev
Author: lukstafi
Date: 2011-01-30 02:54:00 +0000 (Sun, 30 Jan 2011)
Log Message:
-----------
Display heuristics at lower logging level. Optionally turn off monotonicity check.
Modified Paths:
--------------
trunk/Toss/Play/Game.ml
trunk/Toss/Play/Game.mli
trunk/Toss/Server/Server.ml
Modified: trunk/Toss/Play/Game.ml
===================================================================
--- trunk/Toss/Play/Game.ml 2011-01-30 02:27:25 UTC (rev 1289)
+++ trunk/Toss/Play/Game.ml 2011-01-30 02:54:00 UTC (rev 1290)
@@ -11,6 +11,7 @@
let set_debug_level i = (debug_level := i)
let deterministic_suggest = ref false
+let use_monotonic = ref true
(* A global "hurry up!" switch triggered by the timer alarm. *)
let timeout = ref false
@@ -248,7 +249,8 @@
List.map (fun r -> (snd r).ContinuousRule.compiled) rules in
let fluents = Aux.concat_map DiscreteRule.fluents drules in
let frels = Aux.strings_of_list fluents in
- let monotonic = List.for_all DiscreteRule.monotonic drules in
+ let monotonic = !use_monotonic &&
+ List.for_all DiscreteRule.monotonic drules in
let signat_struc =
match struc with Some struc -> struc
| None ->
@@ -263,7 +265,7 @@
Array.mapi (fun i node -> Array.map
(fun payoff ->
(* {{{ log entry *)
- if !debug_level > 5 then (
+ if !debug_level > (* 5 *) 0 then (
Printf.printf
"default_heuristic: Computing for loc %d of payoff %s...\n%!"
i (Formula.sprint_real payoff);
@@ -273,8 +275,16 @@
"default_heuristic: Computing for loc %d\n%!" i;
);
(* }}} *)
- Heuristic.of_payoff ?struc ?fluent_preconds advance_ratio
- frels payoff)
+ let res =
+ Heuristic.of_payoff ?struc ?fluent_preconds advance_ratio
+ frels payoff in
+ (* {{{ log entry *)
+ if !debug_level > (* 6 *) 0 then (
+ Printf.printf "default_heuristic: %s\n%!"
+ (Formula.sprint_real res)
+ );
+ (* }}} *)
+ res)
node.Arena.payoffs) graph
Modified: trunk/Toss/Play/Game.mli
===================================================================
--- trunk/Toss/Play/Game.mli 2011-01-30 02:27:25 UTC (rev 1289)
+++ trunk/Toss/Play/Game.mli 2011-01-30 02:54:00 UTC (rev 1290)
@@ -4,8 +4,8 @@
(** A global "hurry up!" switch triggered by the timer alarm. *)
val get_timeout : unit -> bool
val cancel_timeout : unit -> unit
+val use_monotonic : bool ref
-
(** History stored for a play, including caching of computations for
further use. *)
type memory
Modified: trunk/Toss/Server/Server.ml
===================================================================
--- trunk/Toss/Server/Server.ml 2011-01-30 02:27:25 UTC (rev 1289)
+++ trunk/Toss/Server/Server.ml 2011-01-30 02:54:00 UTC (rev 1290)
@@ -503,7 +503,8 @@
("-s", Arg.String (fun s -> (server := s)), " server (default: localhost)");
("-gdl", Arg.String (fun s ->
GDL.manual_game := s; GDL.manual_translation := true),
- " GDL game for manual (i.e. hard-coded) translation (tictactoe, gomoku, breakthrough)");
+ " GDL game for manual (i.e. hard-coded) translation (tictactoe, breakthrough, etc.)");
+ ("-nm", Arg.Unit (fun () -> Game.use_monotonic := false), " turn monotonicity off");
("-p", Arg.Int (fun i -> (port := i)), " port number (default: 8110)");
("-t", Arg.Int (fun i -> (dtimeout := i)), " timeout (default: none)");
] in
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|