Skip to content
GitLab
Menu
Why GitLab
Pricing
Contact Sales
Explore
Why GitLab
Pricing
Contact Sales
Explore
Sign in
Get free trial
Primary navigation
Search or go to…
Project
B
Brainy
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Privacy statement
Keyboard shortcuts
?
What's new
4
Snippets
Groups
Projects
Show more breadcrumbs
spritely
Brainy
Commits
66b1a6e0
Verified
Commit
66b1a6e0
authored
2 years ago
by
Christine Lemmer-Webber
Browse files
Options
Downloads
Patches
Plain Diff
Enter the first part of the building measurement stuff!
parent
b58b4930
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
tests/test-brainy.scm
+56
-0
56 additions, 0 deletions
tests/test-brainy.scm
with
56 additions
and
0 deletions
tests/test-brainy.scm
+
56
−
0
View file @
66b1a6e0
...
...
@@ -112,4 +112,60 @@
;; (test-equal (interval-high f2c-interval)
;; 290/9))
;; This is straight from Radul's dissertation
(
define
(
fall-duration
t
h
)
;; gravity
(
define
g
(
make-interval
9.789
9.832
))
;; time, squared
(
define
t^2
(
e:square
t
))
;; gravity times time squared
(
define
gt^2
(
e:*
g
t^2
))
;; height: one half of gravity squared
;; (height was already passed in,
;; so we use wiring diagram style)
(
c:*
1
/2
gt^2
h
))
(
define
(
similar-triangles
s-ba
h-ba
s
h
)
(
let
((
ratio
(
spawn-pcell
)))
(
c:*
s-ba
ratio
h-ba
)
(
c:*
s
ratio
h
)))
(
define
barometer-height
(
prun
(
spawn-pcell
)))
(
define
barometer-shadow
(
prun
(
spawn-pcell
)))
(
define
building-height
(
prun
(
spawn-pcell
)))
(
define
building-shadow
(
prun
(
spawn-pcell
)))
(
prun
(
similar-triangles
barometer-shadow
barometer-height
building-shadow
building-height
))
;; Add shadows information first
(
prun
(
add-content
building-shadow
(
make-interval
54.9
55.1
)))
(
prun
(
add-content
barometer-height
(
make-interval
0.3
0.32
)))
(
prun
(
add-content
barometer-shadow
(
make-interval
0.36
0.37
)))
(
test-eqv
(
prun
(
interval-low
(
content
building-height
)))
44.51351351351351
)
(
test-eqv
(
prun
(
interval-high
(
content
building-height
)))
48.977777777777774
)
;; now let's add the fall time
(
define
fall-time
(
prun
(
spawn-pcell
)))
(
prun
(
fall-duration
fall-time
building-height
))
(
prun
(
add-content
fall-time
(
make-interval
2.9
3.1
)))
;; the lower bound should be the same...
(
test-eqv
(
prun
(
interval-low
(
content
building-height
)))
44.51351351351351
)
;; but the upper bound should be more precise
(
test-eqv
(
prun
(
interval-high
(
content
building-height
)))
47.24276000000001
)
;; but now the network has even refined *our* measurements!
(
test-eqv
(
prun
(
interval-low
(
content
barometer-height
)))
0.3
)
; stayed the same
(
test-eqv
(
prun
(
interval-high
(
content
barometer-height
)))
0.3183938287795994
)
; used to be 0.32!
(
test-end
"test-brainy"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment