[Jprogramming] Domain error for explicit conjunction

Raul Miller rauldmiller at gmail.com
Mon Jul 9 15:46:59 UTC 2012


I'm running this right now...

   g =: ? 10 10 $ 2
   0 8 ((g gridExtendPath) aStar manhattanDistance) 5 0

... but it's taking a long time.

And without a working example that I can repeat, I cannot easily
investigate the numbers.

Meanwhile
   'Z' (graphExtendPath aStar 1:) 'A'
doesn't work because graphExtendPath was not in the pastebin.

Still, this is enough to start trying to understand the code.

Unless there's something going on that I do not understand (or unless
there's something that *should be* going on that I do not understand),
you should probably replace

  closed =: closed, last
with
  closed =: ~. closed, last

...but, that said, the expression where closed gets used:
  if. +/ closed (*./^:_@:=)"_1 _ last do. continue. end.
strikes me as odd.  If closed is not empty and if   1 < # ~. last
then this statement does nothing (because two different values in last
cannot be equal to any single value in closed).  Why so much work for
edge cases?  But another possibility is that the rank of closed was
supposed to be 2 instead of 1.

Anyways, perhaps you can cook up an example where it terminates
quickly?  That might make this easier to read.

Thanks,

-- 
Raul

On Mon, Jul 9, 2012 at 10:14 AM, Max Harms <raelifin at gmail.com> wrote:
> g =: ? 10 10 $ 2
> 0 8 ((g gridExtendPath) aStar manhattanDistance) 5 0
>
> Hypothetical Dijkstra's Search on an arbitrary graph:
> 'Z' (graphExtendPath aStar 1:) 'A'
>
> Hypothetical A* for hex grid:
> goal (hexGridExtendPath aStar euclideanDistance) start
>
>  - Max
>
> On Sun, Jul 8, 2012 at 11:02 PM, Raul Miller <rauldmiller at gmail.com> wrote:
>
>> On Sat, Jul 7, 2012 at 8:59 PM, Max Harms <raelifin at gmail.com> wrote:
>> > Here's the functioning code if you're curious:
>> http://pastebin.com/RjQA69j6
>>
>> I'm curious.
>>
>> How do you use this?  (What are some sample sentences.)
>>
>> [Especially when you are working with adverbs and conjunctions, but
>> also even with verbs, examples help illustrate the relevant domains.]
>>
>> Thanks,
>>
>> --
>> Raul
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm


More information about the Programming mailing list