Skip to content

Commit

Permalink
Merge pull request #3192 from JacquesCarette/projOffsetConstraintFix
Browse files Browse the repository at this point in the history
Fix `d_offset` constraint in Projectile
  • Loading branch information
JacquesCarette authored Dec 22, 2022
2 parents 62468cc + c0d2b52 commit 09365d7
Show file tree
Hide file tree
Showing 10 changed files with 12 additions and 18 deletions.
4 changes: 2 additions & 2 deletions code/drasil-example/projectile/lib/Drasil/Projectile/IMods.hs
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ offsetQD = mkQuantDef offset E.offset'
---
messageIM :: InstanceModel
messageIM = imNoDerivNoRefs (equationalModelN (nounPhraseSP "output message") messageQD)
[qwC offset $ UpFrom (Exc, neg (sy landPos))
[qwC offset $ UpFrom (Exc, neg (sy targPos))
,qwC targPos $ UpFrom (Exc, exactDbl 0)]
(qw message)
[] "messageIM" [offsetNote, targPosConsNote, offsetConsNote, tolNote]
Expand Down Expand Up @@ -147,7 +147,7 @@ landPosConsNote = atStartNP (the constraint) +:+

offsetNote = ch offset `S.is` S "from" +:+. refS offsetIM

offsetConsNote = foldlSent [atStartNP (the constraint), eS (sy offset $> neg (sy landPos)) `S.is`
offsetConsNote = foldlSent [atStartNP (the constraint), eS (sy offset $> neg (sy targPos)) `S.is`
S "from the fact that", eS (sy landPos $> exactDbl 0) `sC` S "from", refS posXDirection]

targPosConsNote = atStartNP (the constraint) +:+
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ flightDur = constrainedNRV' (ucs' C.flightDur (subStr lT "flight") Real second)
landPos = constrainedNRV' (ucs' C.landPos (subStr lP "land" ) Real metre) [gtZeroConstr]
launAngle = constrained' (dqd' C.launAngle (autoStage lTheta) Real (Just radian)) [physc $ Bounded (Exc, exactDbl 0) (Exc, half $ sy pi_)] (sy pi_ $/ exactDbl 4)
launSpeed = constrained' (ucs' C.launSpeed (subStr lV "launch") Real velU) [gtZeroConstr] (exactDbl 100)
offset = constrainedNRV' (ucs' C.offset (subStr lD "offset") Real metre) [physc $ UpFrom (Exc, neg $ sy landPos) ]
offset = constrainedNRV' (ucs' C.offset (subStr lD "offset") Real metre) [physc $ UpFrom (Exc, neg $ sy targPos) ]
targPos = constrained' (ucs' C.targPos (subStr lP "target") Real metre) [gtZeroConstr] (exactDbl 1000)

---
Expand Down
6 changes: 3 additions & 3 deletions code/stable/projectile/Jupyter/Projectile_SRS.ipynb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions code/stable/projectile/SRS/HTML/Projectile_SRS.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions code/stable/projectile/SRS/PDF/Projectile_SRS.tex

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 09365d7

Please sign in to comment.