<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html;charset=ISO-8859-1" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Once your XML has stabalised and you are happy with it, I can evetually
help you make an exercise parse if needed - doesn't take long, based on
our existing pluggeable framework.<br>
<br>
mark<br>
Michael Neale wrote:
<blockquote
 cite="mid:96ab3ced0701281520g644d1889kaccd2b773dcd8858@mail.gmail.com"
 type="cite">Yeah the control in XStream is limited of course, but that
XML looks nice enough. You can also easily generate a schema for
reference purposes as needed.<br>
  <br>
Of course, as mark said, we can bake this into a non XML grammar
eventually, but for now, I think that looks fine ! (as long as its
documented with lots of examples !).
  <br>
  <br>
Michael.<br>
  <br>
  <div><span class="gmail_quote">On 1/29/07, <b
 class="gmail_sendername">Mark Proctor</b> &lt;<a moz-do-not-send="true"
 href="mailto:mproctor@codehaus.org">mproctor@codehaus.org</a>&gt;
wrote:</span>
  <blockquote class="gmail_quote"
 style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">As
long as you don't care about controlling the output too much, XStream<br>
is simple and nice.<br>
    <br>
XML is good and quick way to prototype what you are doing, hopefully we<br>
can eventually also build this into the antlr grammar.
    <br>
    <br>
Mark<br>
Geoffrey De Smet wrote:<br>
&gt; Michael told me on irc that XStream might also be a good idea.<br>
&gt;<br>
&gt; Since I 'd like the configuration as a separate domain object
model,<br>
&gt; I tryed it that way and it looks ok:
    <br>
&gt;<br>
&gt;<br>
&gt; &lt;LocalSearchSolver&gt;<br>
&gt;&nbsp;&nbsp; &lt;randomSeed&gt;5&lt;/randomSeed&gt;<br>
&gt;&nbsp;&nbsp; &lt;finish class="StepCountFinish"&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; &lt;maximumStepCount&gt;50&lt;/maximumStepCount&gt;
    <br>
&gt;&nbsp;&nbsp; &lt;/finish&gt;<br>
&gt; &lt;/LocalSearchSolver&gt;<br>
&gt;<br>
&gt; What do you think of such kind of local search solver
configuration?<br>
&gt;<br>
&gt;<br>
&gt;<br>
&gt; Here are the classes that do it, they follow the builder pattern:
    <br>
&gt;<br>
&gt; @XStreamAlias("LocalSearchSolver")<br>
&gt; public class LocalSearchSolverConfig {<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; private long randomSeed = 0;<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; @XStreamAlias("finish")<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; private FinishConfig finishConfig;
    <br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; public LocalSearchSolver build() ...<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt; @XStreamAlias("StepCountFinish")<br>
&gt; public class StepCountFinishConfig implements FinishConfig {<br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; private int maximumStepCount = 100;
    <br>
&gt;<br>
&gt;&nbsp;&nbsp;&nbsp;&nbsp; public Finish build() ...<br>
&gt;<br>
&gt; }<br>
&gt;<br>
&gt;<br>
&gt; which looks a lot easier than fiddling around with sax or DOM?<br>
&gt; Xsd might be a problem - but maybe some day XStream can use the
    <br>
&gt; javadocs to generate an xsd? If not, it shouldn't be to hard to<br>
&gt; replace the config package with a sax or dom based configuration -
or<br>
&gt; just manually write an xsd.<br>
&gt;<br>
&gt; With kind regards,
    <br>
&gt; Geoffrey De Smet<br>
&gt;<br>
&gt;<br>
&gt; Mark Proctor wrote:<br>
&gt;&gt; Look at our xml reader.Its xerces based and pluggeable and
should<br>
&gt;&gt; easily be able to adapt to anything.<br>
&gt;&gt;<br>
&gt;&gt; Mark
    <br>
&gt;&gt; Geoffrey De Smet wrote:<br>
&gt;&gt;&gt; For the solver I 'd like to externalize the configuration
into an<br>
&gt;&gt;&gt; xml(?)&nbsp;&nbsp;file.<br>
&gt;&gt;&gt; something like<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; &lt;localsearch decisionMode="OPTIMAL"&gt;
    <br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;finish steps="500"/&gt;<br>
&gt;&gt;&gt;&nbsp;&nbsp;&nbsp;&nbsp;&lt;ruleBase location="/org/foo/bar/drools.drl"/&gt;<br>
&gt;&gt;&gt; &lt;/localsearch&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; This is a bit inspired by how ehcache is configured, clean
and easy,
    <br>
&gt;&gt;&gt; without any class implementation details: the way users
like it.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; I 've been thinking on doing this with XStream, but that's
not<br>
&gt;&gt;&gt; versatile enough to make user friendly configuration
files. Although
    <br>
&gt;&gt;&gt; Xstream works out great to serialize solutions to and from
xml files.<br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt; Next I was thinking about is JDom or Xom, but that's yet
another<br>
&gt;&gt;&gt; dependency. What would you guys recommend?
    <br>
&gt;&gt;&gt;<br>
&gt;&gt;&gt;<br>
&gt;&gt;<br>
&gt;&gt; _______________________________________________<br>
&gt;&gt; rules-dev mailing list<br>
&gt;&gt; <a moz-do-not-send="true"
 href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
    <br>
&gt;&gt; <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
&gt;&gt;<br>
&gt;<br>
&gt; _______________________________________________<br>
&gt; rules-dev mailing list
    <br>
&gt; <a moz-do-not-send="true" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
&gt; <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a><br>
&gt;<br>
    <br>
_______________________________________________<br>
rules-dev mailing list<br>
    <a moz-do-not-send="true" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a><br>
    <a moz-do-not-send="true"
 href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev
    </a><br>
  </blockquote>
  </div>
  <br>
  <pre wrap="">
<hr size="4" width="90%">
_______________________________________________
rules-dev mailing list
<a class="moz-txt-link-abbreviated" href="mailto:rules-dev@lists.jboss.org">rules-dev@lists.jboss.org</a>
<a class="moz-txt-link-freetext" href="https://lists.jboss.org/mailman/listinfo/rules-dev">https://lists.jboss.org/mailman/listinfo/rules-dev</a>
  </pre>
</blockquote>
<br>
</body>
</html>