How to define a Sampler for an object?

This other version doesn’t change the property of VPDTagPOMDP being a subtype of Sampler. It’s the second argument of the rand definition which must be a subtype of it.
I don’t know what is VPDTagPOMDP, but if it’s not already a Sampler, it looks like your signature should be rand(rng::AbstractRNG, p::Random.SamplerTrivial{VDPTagPOMDP{CardinalBarriers}}).

2 Likes