Ejemplo n.º 1
0
    def solve(self):
        """ Solve the POMDP by executing the solver.

            Returns:
                The POMDPAlphaVectors policy solution to the POMDP.
        """

        policy = pav.POMDPAlphaVectors()

        result = npp._nova.pomdp_pbvi_execute_cpu(self.pomdpPtr, self, policy)
        if result != 0:
            print("Failed to execute the 'nova' library's CPU POMDP solver.")
            raise Exception()

        return policy
Ejemplo n.º 2
0
    def get_policy(self):
        """ Get the policy computed by the solver.

            Returns:
                The POMDPAlphaVectors policy solution to the POMDP.
        """

        policy = pav.POMDPAlphaVectors()

        result = nph._nova.pomdp_hsvi2_get_policy(self.pomdpPtr, self, policy)
        if result != 0:
            print(
                "Failed to get the policy for the 'nova' library's CPU POMDP solver."
            )
            raise Exception()

        return policy