2021-04-26 15:13:52 +02:00
|
|
|
from SystemAct import SystemAct
|
2021-04-26 00:29:07 +02:00
|
|
|
from UserActType import UserActType
|
2021-04-26 15:13:52 +02:00
|
|
|
from SystemActType import SystemActType
|
2021-04-26 00:29:07 +02:00
|
|
|
|
|
|
|
|
|
|
|
class DP:
|
|
|
|
"""
|
2021-04-26 09:57:03 +02:00
|
|
|
Moduł decydujący o wyborze kolejnego aktu, który ma podjąć system prowadząc rozmowę.
|
|
|
|
Wejście: Reprezentacja stanu dialogu (rama)
|
|
|
|
Wyjście: Akt systemu (rama)
|
2021-04-26 00:29:07 +02:00
|
|
|
"""
|
|
|
|
|
|
|
|
def __init__(self):
|
|
|
|
pass
|
|
|
|
|
2021-04-26 15:13:52 +02:00
|
|
|
def chooseTactic(self, frameList=None) -> SystemAct:
|
|
|
|
userAct = frameList[-1]
|
2021-05-16 23:11:55 +02:00
|
|
|
if userAct.getActType() == UserActType.HELLO:
|
2021-04-26 15:13:52 +02:00
|
|
|
return SystemAct(SystemActType.WELCOME_MSG)
|
2021-05-16 23:11:55 +02:00
|
|
|
elif userAct.getActType() == UserActType.BYE:
|
2021-04-26 15:13:52 +02:00
|
|
|
return SystemAct(SystemActType.BYE)
|
2021-05-16 23:11:55 +02:00
|
|
|
elif userAct.getActType() == UserActType.INVALID:
|
2021-04-26 15:13:52 +02:00
|
|
|
return SystemAct(SystemActType.NOT_UNDERSTOOD)
|
2021-05-16 23:11:55 +02:00
|
|
|
else:
|
|
|
|
return SystemAct(SystemActType.INFORM,['name'])
|