(id = None)
| 27 | return ret |
| 28 | |
| 29 | def player_init(id = None): |
| 30 | with open(simulator_profile,'r', encoding='utf-8') as datafile: |
| 31 | data = [] |
| 32 | for line in datafile: |
| 33 | data.append(json.loads(line)) |
| 34 | |
| 35 | role = random.sample(data,1)[0] |
| 36 | if id: |
| 37 | for rl in data: |
| 38 | if rl["id"] == id: |
| 39 | role = rl |
| 40 | #initialize class player, history will be used to store the content |
| 41 | player_data = { |
| 42 | "id":role["id"], |
| 43 | "emo_point": 40, |
| 44 | "emo_state": "Emotion-B", |
| 45 | "player": role["player"], |
| 46 | "scene": role["scene"], |
| 47 | "character": role["main_cha"], |
| 48 | # "topic": role["topic"], |
| 49 | "task": role["task"], |
| 50 | "history": [] |
| 51 | } |
| 52 | |
| 53 | return player_data |
| 54 | |
| 55 | |
| 56 | def planning_reply(player_data): |
no test coverage detected