<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <div class="moz-cite-prefix">If you enable contraction hierarchies
      you currently cannot do on-demand weighting. So disable CH in
      config.properties (prepare.chShortcuts=no) or via
      hopper.setCHEnable(false)<br>
      <br>
      If that is too slow, I fear you have to wait until we build the
      more flexible but still fast routing algorithm.<br>
      <br>
      Regards,<br>
      Peter<br>
      <br>
      <br>
      On 09.12.2014 18:34, Александр Черепанов wrote:<br>
    </div>
    <blockquote
cite="mid:CALkWXCXeqNk1Q8KjGm1fKaxhMRW0aHmbi2dNZVNrKLWPtD8Cng@mail.gmail.com"
      type="cite">
      <div dir="ltr"><br>
        <div class="gmail_quote">---------- Forwarded message ----------<br>
          From: <b class="gmail_sendername">Александр Черепанов</b> <span
            dir="ltr"><<a moz-do-not-send="true"
              href="mailto:lanmaster@hotmail.ru">lanmaster@hotmail.ru</a>></span><br>
          Date: 2014-12-09 17:31 GMT+05:00<br>
          Subject: Cannot change weighting mechanism<br>
          To: <a moz-do-not-send="true"
            href="mailto:graphhopper@openstreetmap.org">graphhopper@openstreetmap.org</a><br>
          <br>
          <br>
          <div dir="ltr">Good day.
            <div>We have modificate our project with this doc:</div>
            <div><a moz-do-not-send="true"
href="https://github.com/graphhopper/graphhopper/blob/0.3/docs/core/weighting.md"
                target="_blank">https://github.com/graphhopper/graphhopper/blob/0.3/docs/core/weighting.md</a><br>
            </div>
            <div><br>
            </div>
            <div>Parameters in config file:</div>
            <div>prepare.chShortcuts=fastest<br>
            </div>
            <div><br>
            </div>
            <div><br>
            </div>
            <div>There is our method:</div>
            <div><br>
            </div>
            <div>
              <div>@Override</div>
              <div>public double calcWeight( EdgeIteratorState edge,
                boolean reverse )</div>
              <div>{</div>
              <div>/*</div>
              <div>        if(forbiddenEdges.contains(edge.getEdge()))</div>
              <div>            return Double.POSITIVE_INFINITY;</div>
              <div>*/</div>
              <div><br>
              </div>
              <div>    double speed = reverse ?
encoder.getReverseSpeed(edge.getFlags()):encoder.getSpeed(edge.getFlags());</div>
              <div>        if (speed == 0)</div>
              <div>            return Double.POSITIVE_INFINITY;</div>
              <div>        double res = Math.random() *
                edge.getDistance() / speed;</div>
              <div>        return res;</div>
              <div>    }</div>
            </div>
            <div><br>
            </div>
            <div>We want to simulate road jamm this way with Random
              weighting, but there is no changes in result track. What
              we are doing wrong?</div>
          </div>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
GraphHopper mailing list
<a class="moz-txt-link-abbreviated" href="mailto:GraphHopper@openstreetmap.org">GraphHopper@openstreetmap.org</a>
<a class="moz-txt-link-freetext" href="https://lists.openstreetmap.org/listinfo/graphhopper">https://lists.openstreetmap.org/listinfo/graphhopper</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>