Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
gendl
gendl
Commits
49396e82
Commit
49396e82
authored
May 22, 2012
by
Dave Cooper
Browse files
added TUD slides, updated g102 slides.
parent
81d20579
Changes
3
Hide whitespace changes
Inline
Side-by-side
documentation/training/g102-tud/examples/source/ch2-examples.lisp
View file @
49396e82
...
...
@@ -92,52 +92,7 @@
(
define-object
fuel-tank
()
:input-slots
(
l
w
h
)
:computed-slots
((
volume
(
*
(
the
l
)
(
the
w
)
(
the
h
)))))
(
define-object
wing-with-tanks
(
empty-surface
)
:input-slots
((
Tmax-list
(
list
1000
800
900
1200
)
:settable
)
(
b
30
)
(
c-root
6
:settable
)
(
c-tip
3
:settable
)
(
tank-data
(
list
(
list
:w
4
:l
3.5
:h
.3
)
(
list
:w
2
:l
2.5
:h
.2
)
(
list
:w
1.5
:l
2
:h
0.15
)))
(
other-inputs
"..."
))
:computed-slots
((
Tmax-total
(
sum-elements
(
the
engines
)
(
the-element
Tmax
)))
(
tank-volume
(
sum-elements
(
the
fuel-tanks
)
(
the-element
volume
)))
(
c-avg
(
/
(
+
(
the
c-root
)
(
the
c-tip
))
2
))
(
taper
(
/
(
the
c-tip
)
(
the
c-root
)))
(
S
(
*
(
the
b
)
(
the
c-avg
)))
(
A
(
/
(
expt
(
the
b
)
2
)
(
the
S
))))
:objects
((
engines
:type
'engine
:sequence
(
:size
(
length
(
the
Tmax-list
)))
:Tmax
(
nth
(
the-child
index
)
(
the
Tmax-list
)))
(
fuel-tanks
:type
'fuel-tank
:sequence
(
:size
(
length
(
the
tank-data
)))
:l
(
getf
(
nth
(
the-child
index
)
(
the
tank-data
))
:l
)
:w
(
getf
(
nth
(
the-child
index
)
(
the
tank-data
))
:w
)
:h
(
getf
(
nth
(
the-child
index
)
(
the
tank-data
))
:h
))))
(
define-object
aircraft
(
base-object
)
...
...
documentation/training/g102-tud/examples/source/ch2-solutions.lisp
View file @
49396e82
...
...
@@ -41,6 +41,52 @@
(
slenderness
(
/
(
the
l
)
(
the
d
)))))
(
define-object
fuel-tank
()
:input-slots
(
l
w
h
)
:computed-slots
((
volume
(
*
(
the
l
)
(
the
w
)
(
the
h
)))))
(
define-object
wing-with-tanks
(
empty-surface
)
:input-slots
((
Tmax-list
(
list
1000
800
900
1200
)
:settable
)
(
b
30
)
(
c-root
6
:settable
)
(
c-tip
3
:settable
)
(
tank-data
(
list
(
list
:w
4
:l
3.5
:h
.3
)
(
list
:w
2
:l
2.5
:h
.2
)
(
list
:w
1.5
:l
2
:h
0.15
)))
(
other-inputs
"..."
))
:computed-slots
((
Tmax-total
(
sum-elements
(
the
engines
)
(
the-element
Tmax
)))
(
tank-volume
(
sum-elements
(
the
fuel-tanks
)
(
the-element
volume
)))
(
c-avg
(
/
(
+
(
the
c-root
)
(
the
c-tip
))
2
))
(
taper
(
/
(
the
c-tip
)
(
the
c-root
)))
(
S
(
*
(
the
b
)
(
the
c-avg
)))
(
A
(
/
(
expt
(
the
b
)
2
)
(
the
S
))))
:objects
((
engines
:type
'engine
:sequence
(
:size
(
length
(
the
Tmax-list
)))
:Tmax
(
nth
(
the-child
index
)
(
the
Tmax-list
)))
(
fuel-tanks
:type
'fuel-tank
:sequence
(
:size
(
length
(
the
tank-data
)))
:l
(
getf
(
nth
(
the-child
index
)
(
the
tank-data
))
:l
)
:w
(
getf
(
nth
(
the-child
index
)
(
the
tank-data
))
:w
)
:h
(
getf
(
nth
(
the-child
index
)
(
the
tank-data
))
:h
))))
(
define-object
aircraft-with-lift
(
base-object
)
...
...
documentation/training/g102-tud/slides/source/ch2.lisp
View file @
49396e82
...
...
@@ -58,16 +58,13 @@
((
:define-object
gdl-user::empty-surface
)))
(
:description
,
(
with-cl-who-string
()
(
:description
,
(
with-htm
((
:span
:class
"gdl-operator"
)
"define-object"
)
" - main operator used in GenDL to create definitions."
))
(
:description
,
(
with-cl-who-string
()
(
:description
,
(
with-htm
((
:span
:class
"gdl-object-def"
)
"empty-surface"
)
" - Name of our new definition."
))
(
:description
,
(
with-cl-who-string
()
(
:description
,
(
with-htm
((
:span
:class
"gdl-object-def"
)
"base-object"
)
" - Name of single mixin (should be pre-defined)."
))))
(
:title
"Basic Wing Skeleton"
...
...
@@ -75,16 +72,19 @@
((
:description
"Define a wing with initial slots, mixes in empty surface to start with"
:examples
((
:define-object
gdl-user::wing
)))
(
:description
,
(
with-cl-who-string
()
(
:description
,
(
with-htm
((
:span
:class
"gdl-object-def"
)
"wing"
)
" - our new definition name."
))
(
:description
,
(
with-cl-who-string
()
(
:description
,
(
with-htm
((
:span
:class
"gdl-object-def"
)
"empty-surface"
)
" - Name of single mixin (which we already defined)."
))
(
:description
,
(
with-cl-who-string
()
(
:description
,
(
with-htm
((
:span
:class
"gdl-section-keyword"
)
":computed-slots"
)
" - constant and computed values which can be
\"answered\" by instances of this definition."
))))
\"answered\" by instances of this definition."
))
(
:description
,
(
with-htm
(
:small
(
:i
"Example code is "
((
:a
:href
"https://github.com/genworks/Genworks-GDL/blob/master/documentation/training/g102-tud/examples/source/ch2-examples.lisp"
)
"here"
)
". Press \"Raw\" for raw downloadable form."
))))))
(
:title
,
(
with-cl-who-string
...
...
@@ -140,7 +140,14 @@
(
:description
"So there is heavy use of \"the\" inside most object definitions:"
:examples
((
:define-object
gdl-user::wing
)))))
((
:define-object
gdl-user::wing
)))
(
:description
,
(
with-htm
(
:small
(
:i
"Example code is "
((
:a
:href
"https://github.com/genworks/Genworks-GDL/blob/master/documentation/training/g102-tud/examples/source/ch2-examples.lisp"
)
"here"
)
". Press \"Raw\" for raw downloadable form."
))))))
(
:title
"Making and Using Objects in \"tasty\""
...
...
@@ -195,7 +202,14 @@
((
:span
:class
"gdl-section-keyword"
)
":input-slots"
)
" to be able to give values to certain slots at the time of an object's birth."
)
:image-url
"uml-2-8.png"
:examples
((
:define-object
gdl-user::wing-with-input
)))))
:examples
((
:define-object
gdl-user::wing-with-input
)))
(
:description
,
(
with-htm
(
:small
(
:i
"Example code is "
((
:a
:href
"https://github.com/genworks/Genworks-GDL/blob/master/documentation/training/g102-tud/examples/source/ch2-examples.lisp"
)
"here"
)
". Press \"Raw\" for raw downloadable form."
))))))
(
:title
,
(
with-htm
((
:span
:class
"gdl-section-keyword"
)
":input-slots"
))
...
...
@@ -227,8 +241,13 @@
:bullet-points
((
:description
"This wing has two settable input-slots"
:image-url
"uml-2-9c.png"
:examples
((
:define-object
gdl-user::wing-more-inputs
)))))
:examples
((
:define-object
gdl-user::wing-more-inputs
)))
(
:description
,
(
with-htm
(
:small
"Example code is "
((
:a
:href
"https://github.com/genworks/Genworks-GDL/blob/master/documentation/training/g102-tud/examples/source/ch2-examples.lisp"
)
"here"
)
". Press \"Raw\" for raw downloadable form."
)))))
(
:title
"Open it in Tasty"
:bullet-points
...
...
@@ -258,7 +277,13 @@
((
:description
"Don't look at this until You Try It:"
:image-url
"uml-2-10b.png"
:examples
((
:define-object
gdl-user::fuselage
)))))
((
:define-object
gdl-user::fuselage
)))
(
:description
,
(
with-htm
(
:small
"Solutions code is "
((
:a
:href
"https://github.com/genworks/Genworks-GDL/blob/master/documentation/training/g102-tud/examples/source/ch2-solutions.lisp"
)
"here"
)
". Press \"Raw\" for raw downloadable form."
)))))
(
:title
"Child Object in a Sequence"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment