Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
O
OUTDATED Verse-library
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
AutonomyCourse_ECEIllinois
OUTDATED Verse-library
Commits
bb7ca4d1
Commit
bb7ca4d1
authored
3 years ago
by
kbraught
Browse files
Options
Downloads
Patches
Plain Diff
add python input example
parent
c6963c3f
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
toythermo.py
+135
-0
135 additions, 0 deletions
toythermo.py
with
135 additions
and
0 deletions
toythermo.py
0 → 100644
+
135
−
0
View file @
bb7ca4d1
#python logic toy code:
from
enum
import
Enum
,
auto
from
ssl
import
VERIFY_X509_PARTIAL_CHAIN
from
statistics
import
mode
from
termios
import
VSTART
class
Modes
(
Enum
):
NormalA
=
auto
()
NormalB
=
auto
()
NormalC
=
auto
()
NormalD
=
auto
()
class
State
:
posx
=
0.0
posy
=
0.0
vx
=
1.0
vy
=
1.0
mode
=
Modes
.
NormalA
def
__init__
(
self
):
self
.
data
=
[]
#todo: how would this actually be given
s
=
State
()
posx
=
s
.
posx
posy
=
s
.
posy
vx
=
s
.
vx
vy
=
s
.
vy
state
=
s
.
mode
if
(
state
==
Modes
.
NormalA
):
if
posy
<
0
and
posy
>=-
0.01
:
vy
=-
vy
posy
=
0
state
=
Modes
.
NormalA
if
(
posx
<
0
and
posx
>=-
0.01
)
:
vx
=-
vx
posx
=
0
state
=
Modes
.
NormalB
if
(
posx
<=
5.01
and
posx
>
5
)
:
vx
=-
vx
posx
=
5
state
=
Modes
.
NormalC
if
(
posy
>
5
and
posy
<=
5.01
)
:
vy
=-
vy
posy
=
5
state
=
Modes
.
NormalD
if
(
state
==
Modes
.
NormalB
)
:
if
(
posy
<
0
and
posy
>=-
0.01
)
:
vy
=-
vy
posy
=
0
state
=
Modes
.
NormalB
if
(
posx
<
0
and
posx
>=-
0.01
)
:
vx
=-
vx
posx
=
0
state
=
Modes
.
NormalA
if
(
posx
<=
5.01
and
posx
>
5
)
:
vx
=-
vx
posx
=
5
state
=
Modes
.
NormalC
if
(
posy
>
5
and
posy
<=
5.01
)
:
vy
=-
vy
posy
=
5
state
=
Modes
.
NormalD
if
(
state
==
Modes
.
NormalC
)
:
if
(
posy
<
0
and
posy
>=-
0.01
)
:
vy
=-
vy
posy
=
0
state
=
Modes
.
NormalC
if
(
posx
<
0
and
posx
>=-
0.01
)
:
vx
=-
vx
posx
=
0
state
=
Modes
.
NormalA
if
(
posx
<=
5.01
and
posx
>
5
)
:
vx
=-
vx
posx
=
5
state
=
Modes
.
NormalB
if
(
posy
>
5
and
posy
<=
5.01
)
:
vy
=-
vy
posy
=
5
state
=
Modes
.
NormalD
if
(
state
==
State
.
Modes
.
NormalD
)
:
if
(
posy
<
0
and
posy
>=-
0.01
)
:
vy
=-
vy
posy
=
0
state
=
Modes
.
NormalD
if
(
posx
<
0
and
posx
>=-
0.01
)
:
vx
=-
vx
posx
=
0
state
=
Modes
.
NormalA
if
(
posx
<=
5.01
and
posx
>
5
)
:
vx
=-
vx
posx
=
5
state
=
Modes
.
NormalB
if
(
posy
>
5
and
posy
<=
5.01
)
:
vy
=-
vy
posy
=
5
state
=
Modes
.
NormalC
s
.
posx
=
posx
s
.
posy
=
posy
s
.
vx
=
vx
s
.
vy
=
vy
s
.
mode
=
state
#TODO: what is output?
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