chickadee » aima » write-world-as-pdf

write-world-as-pdf world agent pdfprocedure

Output the graph-world as a pdf via graphviz.

world
The world to output
agent
The agent that inhabits the world
pdf
The file to write to
(define (write-world-as-pdf world agent pdf)
  (receive
    (input output id)
    (process "neato" `("-Tpdf" "-o" ,pdf))
    (with-output-to-port
      output
      (lambda () (write-world-as-dot world agent #f #f #f #f #f)))
    (flush-output output)
    (close-output-port output)
    (close-input-port input)))