Re: [eclipse-users] node(daVinci) and uDraw(Graph)

From: Kish Shen <kish_at_...2...>
Date: Wed, 05 Dec 2007 19:12:39 +0000
Hi Tias,

I think the problem with the lib(daVinci) only drawing the graph once is 
a known problem. The current API for daVinci seems to be:

...various commands to add nodes/edges to the graph

the various commands to add nodes/edges generates command for the 
daVinci API directly, and are written to a stream. daVinci_end closes 
some of these streams (including daVinciAttribute) and sends the daVinci 
commands to daVinci to plot the graph. The `illegal stream 
specification' error you get is because the stream was closed by the 
daVinci_end after the first solution is plotted.

If what you want to do is simply to add more nodes and edges to the 
graph (rather than deleting nodes that you have backtracked over) on 
subsequent plots of the graph, it may be relatively easy to do -- 
looking at the uDraw documentation, it looks like you can add (and 
delete) nodes/edges from the graph. So either daVince_end can be 
modified to 1) not close the streams, and 2) send commands to add the 
new nodes/edges, or a new command can be added to lib(daVinci) to just 
plot a graph or modify the existing plot.

I seem to remember that a few years ago, daVinci went commercial, and so 
we have not really spent too much effort on maintaining/improving 
lib(daVinci). Looking at the link you provided, it seems as if it is now 
freely available. We would really welcome any improvements in this library!



Tias Guns wrote:
> Hello,
> Apparently the daVinci graph drawing tool is renamed to uDraw(Graph)
> Fortunately there is no API change, so ECLiPSe can perfectly well work  
> with it.
> The thing I did was:
> 1) unpack uDrawGraph somewhere, for me: /home/tias/local/uDrawGraph-3.1
> 2) add DAVINCIHOME="/home/tias/local/uDrawGraph-3.1"; export DAVINCIHOME
> or something similar to your .bashrc
> 3) go to your /home/tias/local/uDrawGraph-3.1 dir, and do: ln -s  
> bin/uDrawGraph daVinci
> On linux systems, this works perfectly well.
> Unfortunately, the graph drawing only works for the first solution. This  
> problem always occurs, independant of using uDrawGraph or the old daVinci.
> Reproducing the bug:
> 1) download the queens example:  
> 2) change 'labeling(Board).' with 'search(Board, 0, input_order, indomain,  
> complete, [node(daVinci)]).'
> 3) run queens_lists(6,B).
> This is what you will get:
> <<<<<<<<<
> [eclipse 1]: queens_lists(6,B).
>  loaded traceable 0 bytes in 0.00 seconds
> loaded traceable 0 bytes in 0.01 seconds
> B = [2, 4, 6, 1, 3, 5]
> Yes (0.01s cpu, solution 1, maybe more) ? ;
> %%% draws the first part of the search tree here
> illegal stream specification in printf(daVinciAttribute, ',', [])
> Abort
> What I would have hoped to happen is that when generating the next answer,  
> the graph would get a new branch in the nodes at which the backtracking  
> happens.
> The error happens on line 385 of daVinci.ecl:
> da_comma(Stream):-
>      printf(Stream,',',[]).
> I have tried to fix this, but I do not find a way.
> Is it possible to make this graph drawing work over multiple solutions ?  
> It is only usefull to me if this would work.
> Many thanks in advance,
> Tias
> _______________________________________________
> ECLiPSe-Users mailing list
> ECLiPSe-Users_at_...2...
Received on Wed Dec 05 2007 - 19:13:10 CET

This archive was generated by hypermail 2.3.0 : Tue Aug 20 2019 - 00:14:49 CEST