;;;; -*- Scheme -*- ;; ;; Beacons example for HLSIM ;; ;; David DeRoure June 12 1997, revised Sep 11 1997 ;; dder@martigny.ai.mit.edu ;; ;; This is the simulation setup for beacons1.scm. See the HLSIM documentation ;; for further details. (load-option 'hlsim) ;; If you are using this example for the very first time, you need some ;; compiled files available to load. If you do not have these, you can ;; generate them with the following: (cf "util1d") ; normal compilation (scm -> bin -> com) (cf "beacons1d") ; normal compilation (scm -> bin -> com) (cps "beacons1") ; gunk compilation (scm -> bin), generates beacons1.bin (cbf "beacons1") ; gunk compilation (bin -> com), generates beacons1.com ;; If you have the compiled files, start from here (load "util1d") (load "beacons1d") ;; Make the simulation (set! *store-size* 50) ;; Go from here to run different simulations. ;; The mean neighborhood density is just under n * pi * r^2 ;; e.g. for a quick simulation try 1000 procs, radius 0.05, n pi r^2 = 7.9 (define sim (make-sim/1 1000 0.05)) ;; e.g. for a large simulation try 10000 procs, radius 0.02, n pi r^2 = 12.6 ;; Note this used make-sim/f and hence has variable mean neighborhood density. ; (define sim (make-sim/f 10000 0.02)) ;; Nominate two source processors, at (0.33, 0.33) and (0.66, 0.66) (simulation.set! sim 'source-processors (list (simulation.find-processor-nearest sim 0.33 0.33) (simulation.find-processor-nearest sim 0.66 0.66))) (simulation.display! sim #T) (simulation.load sim 'init "beacons1") (simulation.run sim) ;; end of beacons1s.scm