Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
B
BN_GenerativeModel
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
Service Desk
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
Antonio Andriella
BN_GenerativeModel
Commits
f4a9110e
Commit
f4a9110e
authored
4 years ago
by
Antonio Andriella
Browse files
Options
Downloads
Patches
Plain Diff
Fix bug on correct move counter
parent
d8dc7464
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
main.py
+11
-8
11 additions, 8 deletions
main.py
with
11 additions
and
8 deletions
main.py
+
11
−
8
View file @
f4a9110e
...
...
@@ -32,6 +32,7 @@ def compute_next_state(user_action, task_progress_counter, attempt_counter, corr
max_attempt_counter
'''
# if then else are necessary to classify the task game state into beg, mid, end
if
user_action
==
1
:
...
...
@@ -51,7 +52,6 @@ def compute_next_state(user_action, task_progress_counter, attempt_counter, corr
attempt_counter
=
1
max_attempt_counter
+=
1
task_progress_counter
+=
1
correct_move_counter
+=
1
# TODO call the function to compute the state of the game (beg, mid, end)
...
...
@@ -65,6 +65,7 @@ def compute_next_state(user_action, task_progress_counter, attempt_counter, corr
else
:
game_state_counter
=
3
next_state
=
(
game_state_counter
,
attempt_counter
,
user_action
)
return
next_state
,
task_progress_counter
,
game_state_counter
,
attempt_counter
,
correct_move_counter
,
wrong_move_counter
,
timeout_counter
,
max_attempt_counter
...
...
@@ -280,12 +281,14 @@ def simulation(bn_model_user_action, var_user_action_target_action, bn_model_use
print
(
"
current_state
"
,
current_state
,
"
next_state
"
,
next_state
)
####################################END of EPISODE#######################################
print
(
"
task_evolution {}, attempt_counter {}, correct_counter {}, wrong_counter {}, timeout_counter {}
"
.
format
(
game_state_counter
,
iter_counter
,
correct_move_counter
,
wrong_move_counter
,
timeout_counter
))
print
(
"
robot_assistance_per_action {}
"
.
format
(
robot_assistance_per_action
))
print
(
"
attempt_counter_per_action {}
"
.
format
(
attempt_counter_per_action
))
print
(
"
game_state_counter_per_action {}
"
.
format
(
game_state_counter_per_action
))
print
(
"
robot_feedback_per_action {}
"
.
format
(
robot_feedback_per_action
))
print
(
"
iter {}, correct {}, wrong {}, timeout {}
"
.
format
(
iter_counter
,
correct_move_counter
,
wrong_move_counter
,
timeout_counter
))
print
(
"
game_state_counter {}, iter_counter {}, correct_counter {}, wrong_counter {},
"
"
timeout_counter {}, max_attempt {}
"
.
format
(
game_state_counter
,
iter_counter
,
correct_move_counter
,
wrong_move_counter
,
timeout_counter
,
max_attempt_counter
))
# print("robot_assistance_per_action {}".format(robot_assistance_per_action))
# print("attempt_counter_per_action {}".format(attempt_counter_per_action))
# print("game_state_counter_per_action {}".format(game_state_counter_per_action))
# print("robot_feedback_per_action {}".format(robot_feedback_per_action))
# print("iter {}, correct {}, wrong {}, timeout {}".format(iter_counter, correct_move_counter, wrong_move_counter, timeout_counter))
#save episode
episodes
.
append
(
episode
)
...
...
@@ -349,7 +352,7 @@ def simulation(bn_model_user_action, var_user_action_target_action, bn_model_use
#SIMULATION PARAMS
epochs
=
10
0
epochs
=
10
#initialise the robot
bn_model_robot_assistance
=
bnlearn
.
import_DAG
(
'
bn_robot_model/robot_assistive_model.bif
'
)
...
...
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