def __init__(self, args):
        """
        Load the ontology and database and initialize some internal structures

        :param args: the policy's arguments
        """
        super(CalculatedPolicy, self).__init__()

        self.ontology = None
        if 'ontology' in args:
            ontology = args['ontology']

            if isinstance(ontology, Ontology):
                self.ontology = ontology
            else:
                raise ValueError('CalculatedPolicy Unacceptable '
                                 'ontology type %s ' % ontology)
        else:
            raise ValueError('CalculatedPolicy: No ontology provided')

        self.database = None
        if 'database' in args:
            database = args['database']

            if isinstance(database, DataBase):
                self.database = database
            else:
                raise ValueError('CalculatedPolicy: Unacceptable '
                                 'database type %s ' % database)
        else:
            raise ValueError('CalculatedPolicy: No database provided')

        self.agent_id = args['agent_id'] if 'agent_id' in args else 0
        self.agent_role = \
            args['agent_role'] if 'agent_role' in args else 'system'

        domain = args['domain'] if 'domain' in args else None

        # True for greedy, False for stochastic
        self.IS_GREEDY_POLICY = True

        self.policy_path = None

        self.policy = None

        # Extract lists of slots that are frequently used
        self.informable_slots = \
            deepcopy(list(self.ontology.ontology['informable'].keys()))
        self.requestable_slots = \
            deepcopy(self.ontology.ontology['requestable'] + ['this'])
        self.system_requestable_slots = \
            deepcopy(self.ontology.ontology['system_requestable'])

        self.dstc2_acts = None

        # Plato does not use action masks (rules to define which
        # actions are valid from each state) and so training can
        # be harder. This becomes easier if we have a smaller
        # action set.

        if not domain:
            # Default to CamRest dimensions
            self.NStateFeatures = 56

            # Default to CamRest actions.
            # Does not include inform and request that are modelled together
            # with their arguments
            self.dstc2_acts = ['offer', 'canthelp', 'affirm', 'negate', 'deny',
                               'ack', 'thankyou', 'bye', 'reqmore',
                               'hello', 'welcomemsg', 'expl-conf', 'select',
                               'repeat', 'reqalts', 'confirm-domain',
                               'confirm']
        else:
            # Try to identify number of state features
            if domain in ['CamRest', 'SFH', 'SlotFilling']:
                d_state = \
                    SlotFillingDialogueState(
                        {
                            'slots':
                                self.ontology.ontology['system_requestable']})

                # Sub-case for CamRest
                if domain == 'CamRest':
                    # Does not include inform and request that are modelled
                    # together with their arguments
                    self.dstc2_acts = ['offer', 'canthelp', 'affirm', 'negate',
                                       'deny', 'ack', 'thankyou', 'bye',
                                       'reqmore', 'hello', 'welcomemsg',
                                       'expl-conf', 'select', 'repeat',
                                       'reqalts',
                                       'confirm-domain', 'confirm']

            else:
                print('Warning! domain has not been defined. Using SlotFilling'
                      ' dialogue State')
                d_state = \
                    SlotFillingDialogueState(
                        {
                            'slots':
                                self.ontology.ontology['system_requestable']})

            d_state.initialize()

        if self.dstc2_acts:
            self.NActions = len(self.dstc2_acts) + len(self.requestable_slots)

            if self.agent_role == 'system':
                self.NActions += len(self.system_requestable_slots)

            elif self.agent_role == 'user':
                self.NActions += len(self.requestable_slots)
        else:
            if self.agent_role == 'system':
                self.NActions = 4 + len(self.system_requestable_slots) + \
                                len(self.requestable_slots)

            elif self.agent_role == 'user':
                self.NActions = 3 + 2 * len(self.requestable_slots)

        Load the ontology and database and initialize some internal structures

        :param args: the policy's arguments
        
plato/agent/component/dialogue_policy/calculated_policy.py