pyrddlgym-project / pyRDDLGym-symbolic

Symbolic compilation of RDDL domains, Dynamic Bayes net (DBN) visualization, symbolic dynamic programming (SDP).
https://pyrddlgym.readthedocs.io/en/latest/xadd.html
MIT License
2 stars 1 forks source link

RDDLNotImplementedError: Distribution KronDelta does not allow reparameterization #1

Closed GMMDMDIDEMS closed 8 months ago

GMMDMDIDEMS commented 8 months ago

If I see it correctly there are some typos in def randomvar_to_xadd(self, expr: Expression) in the elif statements. krondelta should be KronDelta and exponential must be Exponential.

In the method description I read:

Currently, self.reparam should be set to True for all rvs except for Bernoulli.

How should one set self.param if a domain uses multiple distributions, e.g. Navigation. Due to the assertion in line 259 self.reparam must be True:

    cpfs {

        robot-at'(?x,?y) =

            if ( GOAL(?x,?y) ^ robot-at(?x,?y)  )
            then 
                KronDelta(true)
            else if (( exists_{?x2 : xpos, ?y2 : ypos} [ GOAL(?x2,?y2) ^ robot-at(?x2,?y2)  ] )
                     | ( move-north ^ exists_{?y2 : ypos} [ NORTH(?y,?y2) ^ robot-at(?x,?y) ] )
                     | ( move-south ^ exists_{?y2 : ypos} [ SOUTH(?y,?y2) ^ robot-at(?x,?y) ] )
                     | ( move-east ^ exists_{?x2 : xpos} [ EAST(?x,?x2) ^ robot-at(?x,?y) ] )
                     | ( move-west ^ exists_{?x2 : xpos} [ WEST(?x,?x2) ^ robot-at(?x,?y) ] ))
            then 
                KronDelta(false) 
            else if (( move-north ^ exists_{?y2 : ypos} [ NORTH(?y2,?y) ^ robot-at(?x,?y2) ] )
                     | ( move-south ^ exists_{?y2 : ypos} [ SOUTH(?y2,?y) ^ robot-at(?x,?y2) ] )
                     | ( move-east ^ exists_{?x2 : xpos} [ EAST(?x2,?x) ^ robot-at(?x2,?y) ] )
                     | ( move-west ^ exists_{?x2 : xpos} [ WEST(?x2,?x) ^ robot-at(?x2,?y) ] ))
            then 
                Bernoulli( 1.0 - P(?x, ?y) ) 
            else 
                KronDelta( robot-at(?x,?y) );
jihwan-jeong commented 8 months ago

This has been fixed in commit b56583f4a7c9.