Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mrk022
AICogSciFinalProject
Commits
77efe1b5
Commit
77efe1b5
authored
Nov 26, 2019
by
mrk022
Browse files
tutor file
parent
f88ba9d7
Changes
1
Hide whitespace changes
Inline
Side-by-side
tutor.py
0 → 100644
View file @
77efe1b5
import
ccm
from
ccm.lib.actr
import
*
class
UserState
(
ccm
.
ProductionSystem
):
#moveConstants = "0" # move constants is 0 when need to move them, 1 when move variables, 2 when neither
ready
=
False
def
init
(
self
,
equation
):
self
.
equation
=
equation
self
.
state
=
"none"
self
.
end
=
False
def
get_input
():
user_step
=
input
(
"Please enter your next step: "
)
#figure out what user step means
# call some get_state() function comparing user step to what state should be
self
.
state
=
"move_constants"
ready
=
True
def
moveConstants
():
print
(
"Constants moved to one side of equation"
)
#self.state = "move_constants"
def
moveVariables
():
print
(
"Variables moved to one side of equation"
)
#self.state = "move_variables"
class
IntelligentTutor
(
ACTR
):
goal
=
Buffer
()
user
=
UserState
()
def
init
(
self
):
user
.
get_input
()
goal
.
set
(
user
.
state
)
def
moved_constants
(
user
=
"ready:True"
,
goal
=
"move_constants"
):
user
.
moveConstants
()
goal
.
set
(
"add_constants"
)
def
add_constants
(
goal
=
"add_constants"
):
goal
.
set
(
"move_variables"
)
def
moved_variables
(
user
=
"ready:True"
,
goal
=
"move_variables"
):
user
.
moveVariables
()
goal
.
set
(
"add_variables"
)
def
add_variables
(
goal
=
"add_variables"
):
goal
.
set
()
def
end_process
(
goal
=
"end_process"
):
goal
.
set
(
"Simulation Complete!"
)
self
.
stop
()
class
EmptyEnvironment
(
ccm
.
Model
):
pass
def
main
():
#eqn = "3x + 4 = 0"
env_name
=
EmptyEnvironment
()
agent_name
=
IntelligentTutor
()
env_name
.
agent
=
agent_name
ccm
.
log_everything
(
env_name
)
env_name
.
run
()
main
()
\ No newline at end of file
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