carlofazioli / cardiathena

A project to study strategies in the game of hearts, using distributed computing, AI, and data analytics.
GNU General Public License v3.0
6 stars 1 forks source link

Implement Save_game() #32

Closed davidjha closed 4 years ago

davidjha commented 4 years ago

Description

Implement save_game() so that state and action can be saved into a SQL database

Tasks

davidjha commented 4 years ago

I was able to convert the self.values from the state into a json object and insert that into the mysql database. I have not done this with the action histories, or the scoring information. So my database schema has one table. The columns are gameid (auto incrementing int), and a sql json object that contains the entire history of a game.

aphelps4 commented 4 years ago

I have split the tasks up a bit more since you do have some stuff done for this issue but could not represent that before. I also edited the description to not talk about score histories since that would be included with the state and is redundant to bring up.

davidjha commented 4 years ago

I see that we have state_histories, action_histories, and state_action_histories. Do we need all three of these?

aphelps4 commented 4 years ago

Oh no. It was just that originally there was a list for state_histories and action_histories and none for state_action_histories even though that was the one we needed. I was wondering if it did not work for some reason and saw that it did work when I added it but I was afraid to just delete the other two that existed before I touched it.

davidjha commented 4 years ago

Save_game() can now save states, actions, and score history into the database as a MySQL json format.