-
Notifications
You must be signed in to change notification settings - Fork 0
/
om-darwin-master.lisp
105 lines (78 loc) · 3.31 KB
/
om-darwin-master.lisp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
(unless (find-package "OM-DARWIN")
(defpackage "OM-DARWIN"
(:nicknames "DWN" "D")
(:use "COMMON-LISP" "CL-USER" "OM-API" "LISPWORKS" "HCL" "OM-LISP" "OM")))
(in-package om)
(export '(om::rrnd om::mki) "OM")
;(require-library "om-geof")
;(require-library "om-enved")
;--------------------------------------------------
;Variable definiton with files to load
;--------------------------------------------------
(defvar *lib-folder* nil)
(setf *lib-folder* (or *load-pathname* (om-choose-directory-dialog :prompt "om-darwin directory")))
(defvar *res-dir* nil)
(setf *res-dir* (append (pathname-directory *lib-folder*) (list "resources")))
(defvar *source-files* nil)
(setf *source-files*
'( "dwn.utils"
"dwn.basic"
"dwn.arrange2"
"dwn.defspecies"
"dwn.multi-cell"
"dwn.defspecies-builtin" ;; rename
"dwn.spec.trees"
"dwn.criterion3"
"dwn.criterion-utils"
;reorganize these two files
"dwn.engine"
"dwn.om2"
"dwn.maquette"
"dwn.tests"
))
;--------------------------------------------------
;Load files
;--------------------------------------------------
(mapc #'(lambda (file)
;; to populate dwn::*species-info-alist*
(when (member file '("dwn.defspecies-builtin" "dwn.multi-cell" "dwn.om2") :test #'string-equal)
(load (make-pathname :directory (append (pathname-directory *lib-folder*)
(list "darwin-sources"))
:name file
:type "lisp")))
(compile&load (make-pathname :directory (append (pathname-directory *lib-folder*)
(list "darwin-sources"))
:name file)))
*source-files*)
;--------------------------------------------------
; OM subpackages initialization
; ("sub-pack-name" subpacke-lists class-list function-list class-alias-list)
;--------------------------------------------------
(defvar *darwin-subpackages* nil)
(setf *darwin-subpackages*
'( ("species" nil nil (make-ga-chord
make-ga-chord-seq
make-even-melody
make-grid-melody
make-ga-tree
make-multi
make-stack
make-arrangement) nil)
("criteria" nil nil (c-list
c-pitches
c-melodic
c-harmonic
c-oblique
c-regions
c-chords
c-voices
c-operons
c-block
c-pc
c-print
))
("engine" nil (d::ga-engine) (evolute phenotype evaluate d::result d::start d::stop d::set-fitness-function) nil)))
;--------------------------------------------------
;filling packages
;--------------------------------------------------
(fill-library *darwin-subpackages*)