X-Git-Url: http://git.shadowcat.co.uk/gitweb/gitweb.cgi?a=blobdiff_plain;f=lib%2FDX%2FSolver.pm;h=c425b27d4cff86a407cb35bc2ae4e2f8d51fbb80;hb=5ef4d923edc14eadf67d64e92001f2f7bfa63986;hp=05523ecd3b48a4bbd110b3c4a6a6710b32f27c1b;hpb=734376d95c5cc96cc52cd0346d9691c32390e792;p=scpubgit%2FDKit.git diff --git a/lib/DX/Solver.pm b/lib/DX/Solver.pm index 05523ec..c425b27 100644 --- a/lib/DX/Solver.pm +++ b/lib/DX/Solver.pm @@ -12,6 +12,8 @@ has rule_set => (is => 'lazy', handles => [ 'add_rule' ], builder => sub { has facts => (is => 'ro', required => 1); +has observation_policy => (is => 'ro'); + sub query { my ($self, $vars, @terms) = @_; my $rule_set = $self->rule_set; @@ -27,7 +29,10 @@ sub query { rule_set => $rule_set, )->assign_vars(map +($_ => {}), @$vars); return DX::ResultStream->new( - for_state => $state + for_state => $state, + ($self->observation_policy + ? (observation_policy => $self->observation_policy) + : ()), ); }