GithubHelp home page GithubHelp logo

hypertension_u's People

Contributors

maumagnaguagno avatar meneguzzi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

hypertension_u's Issues

License ?

Hello, under what license is this project released under ? Thank-you.

Refer to line errors in Parser

I'm getting errors of the type:

hype.sh healthcare.ujshop pbhealthcare-test.ujshop
Script at  /Users/meneguzzi/Documents/workspace-planning/HyperTension_U
Axiom p parameters redefined, from ["?c", "c1", ["?t"]] to ["?c", "c2", ["?t"]]
/Users/meneguzzi/Documents/workspace-planning/HyperTension_U/UJSHOP_Parser.rb:157:in `parse_domain'
/Users/meneguzzi/Documents/workspace-planning/HyperTension_U/Hype.rb:32:in `parse'
/Users/meneguzzi/Documents/workspace-planning/HyperTension_U/Hype.rb:81:in `<main>'

But I simply cannot find where exactly in the files these errors are coming from. It's sort of urgent to sort it out.

Best,

Felipe

Unnecessary free variables in Healthcare domain operators

Both operators suspendG and reactivateG have a free variable ?g.

(:operator (!suspendG ?gi ?a ?gv)
  ( (goal ?g ?gi ?a) (not (terminalG ?g ?gi ?gv)) (not (nullG ?g ?gi ?gv)) )
  ( (activatedG ?g ?gi ?gv) )
  ( (suspendedG ?g ?gi ?gv) )
  1 
)
;...
(:operator (!reactivateG ?gi ?a ?gv)
  ( (goal ?g ?gi ?a) (suspendedG ?g ?gi ?gv) (not (terminalG ?g ?gi ?gv)) (not (nullG ?g ?gi ?gv)) )
  ( (suspendedG ?g ?gi ?gv) )
  ( (activatedG ?g ?gi ?gv) )
  1
)

Each operator is applied once by methods that already have ?g, we could propagate this value.

(:method (backBurner ?g ?gi ?gv ?c ?ci ?cv ?d ?a)
  ((goal ?g ?gi ?d) (activeG ?g ?gi ?gv) (commitment ?c ?ci ?d ?a) (pending ?c ?ci ?cv))
  ((!suspendG ?gi ?d ?gv))
)
(:method (frontBurner ?g ?gi ?gv ?c ?ci ?cv ?d ?a)
  ((goal ?g ?gi ?d) (suspendedG ?g ?gi ?gv) (commitment ?c ?ci ?d ?a) (detached ?c ?ci ?cv))
  ((!reactivateG ?gi ?d ?gv))
)

Other goal related operators already have a parameter ?g.
Is there any reason to keep ?g a free variable?

Healthcare plan correctness

Even without the entire domain converted we have our first plan for Healthcare.
EDIT: now emulating lists, so we can see parentheses around terms.

> ruby pbhealthcare.ujshop.rb -d
----------------------Tasks-----------------------
0: hospitalScenario()
1: testCommitments()
---------------------Planning---------------------
hospitalScenario_case0()
  seekHelp_case0(alice)
    create(C1,C1,bob,alice,(nil))
    requestAssessment(alice,bob)
    processPatient_process_patient_healthy(alice)
      performImagingTests_imaging(alice)
        create(C2,C2,alice,bob,(clyde))
        create(C5,C5,clyde,bob,(doug))
        requestImaging(bob,alice,clyde)
        attendTest_attend_imaging(alice)
          performImaging(clyde,alice,bob)
          performPathologyTests_biopsy_unnecessary(alice)
            deliverDiagnostics_only_imaging(alice)
              requestRadiologyReport(bob,clyde,alice)
              sendRadiologyReport(clyde,bob,alice)
              generateTreatmentPlan(bob,alice)
              testCommitments_case0()
                testCommitment_case0(C1,C1,nil,satisfied)
                  invisible_testFailure(C1,satisfied)
                  testCommitment_case0(C2,C2,nil,satisfied)
                    invisible_testFailure(C2,satisfied)
                    testCommitment_case0(C3,C3,nil,satisfied)
                      invisible_testFailure(C3,satisfied)
                      testCommitment_case0(C4,C4,nil,satisfied)
                        invisible_testFailure(C4,satisfied)
                        testCommitment_case0(C5,C5,nil,satisfied)
                          invisible_testFailure(C5,satisfied)
                          testCommitment_case0(C6,C6,nil,satisfied)
                            invisible_testFailure(C6,satisfied)
                            testCommitment_case0(C7,C7,nil,satisfied)
                              invisible_testFailure(C7,satisfied)
                              testCommitment_case0(C8,C8,nil,satisfied)
                                invisible_testFailure(C8,satisfied)
Time: 0.04680013656616211s
Plans found: 1
----------------------Plan 1----------------------
Valuation: 0
Probability: 1
0: create(C1, C1, bob, alice, (nil))
1: requestAssessment(alice, bob)
2: create(C2, C2, alice, bob, (clyde))
3: create(C5, C5, clyde, bob, (doug))
4: requestImaging(bob, alice, clyde)
5: performImaging(clyde, alice, bob)
6: requestRadiologyReport(bob, clyde, alice)
7: sendRadiologyReport(clyde, bob, alice)
8: generateTreatmentPlan(bob, alice)

Unexpected behavior is appearing in this problem:

  • Method seekHelp propagates (nil) in the original version, and is visible as the empty last term of the first action in the plan.
  • Method testCommitments propagates unbounded variables cvN, as a workaround I set them to nil.

The issue is how to deal with such behavior and if it is resulting in an incorrect plan.

Possible typo in requestBiopsy from Healthcare domain

Operator requestBiopsy receives a ?pathologist instead of a ?radiologist as specified by method performPathologyTests.

(:operator (!requestBiopsy ?physician ?patient ?pathologist)
  (and (physician ?physician) (patient ?patient) (radiologist ?radiologist)) ;Pre
  () ;Del
  ((bAppointmentRequested ?patient ?radiologist) (biopsyRequested ?physician ?patient)) ;Add
  1 ; Cost
)
(:method (performPathologyTests ?patient)
  imaging-plus-biopsy
  (
    (patient ?patient) (physician ?physician)
    (radiologist ?radiologist)
    (pathologist ?pathologist)
    ;(conditional C1 ?Ci ?Cv)
    (commitment C3 ?Ci3 ?patient ?physician)
    (commitment C4 ?Ci4 ?radiologist ?physician)
  )
  (
    (!create C3 ?Ci3 ?patient ?physician (?radiologist))
    (!create C4 ?Ci4 ?radiologist ?physician (?pathologist))
    (!requestBiopsy ?physician ?patient ?radiologist) ; <= HERE
    (attendTest ?patient)
  )
)

Missing operators in Healthcare domain

Operators manufactureGoods, sendGoods and sendPayment appear in subtasks for methods that achieve agent goals, but are not defined in the domain. The variable ?t is also not bounded by any precondition.

;; Redo from here on before testing.
(:method (achieveGoal g2 ?gi  c)
  ((activeG g2 ?gi ) (goal g2 ?gi c) )
  ((!manufactureGoods c ?t))
)
(:method (achieveGoal g3 ?gi  m)
  ((activeG g3 ?gi ) (goal g3 ?gi m))
  ((!sendGoods m c ?t))
)
(:method (achieveGoal g4 ?gi  c)
  ((activeG g4 ?gi ) (goal g4 ?gi c))
  ((!sendPayment c m ?t))
)
(:method (detach ?c ?ci )
  ((call = ?c c1) (active ?c ?ci ) (commitment ?c ?ci ?a ?d)) ;FM (2013/01/17) Changed the precondition to be more generic
  ((!sendPayment ?d ?a ?t)) ;FM Was ((!sendPayment c m ?t))
  ((call = ?c c5) (active ?c ?ci ) (commitment ?c ?ci ?a ?d)) ;FM (2013/01/17) Changed the precondition to be more generic
  ((!sendGoods ?d ?a ?t)) ; FM Was ((!sendGoods m c ?t))
)

Wrong arity for axioms p and q in Healthcare domain

Axiom satisfied calls axiom q with 3 instead of 2 terms, which always evaluates to false.

(:- (satisfied ?c ?ci ?cv)
  (and (not (null ?c ?ci ?cv)) (not (terminal ?c ?ci ?cv)) (q ?c ?ci ?cv))
)

Axiom q is defined by one variable and one constant parameter, the version with 3 terms appear commented in other places.

(:- (q ?c C1)
  (and (commitment ?c ?ci ?d ?a) (var ?c ?ci ) (and (diagnosisProvided ?d ?a)) )
)

Method testCommitment presents the same problem for axiom p:

(:method (testCommitment ?c ?ci ?cv ?s)
  ; ...
  ((commitment ?c ?ci ?d ?a) (call = ?s p) (p ?c ?ci ?cv)) ; <= HERE
  ((!!testSuccess ?c ?ci ?cv ?s))

  ((commitment ?c ?ci ?d ?a) (call = ?s q) (q ?c ?ci))
  ((!!testSuccess ?c ?ci ?cv ?s))

  failed
  ((commitment ?c ?ci ?d ?a))
  ((!!testFailure ?c ?s))
)

Add new reward types

Rewards are currently only triggered from false to true, and vice-versa with the use of not.
We need to expand the concept to support maintenance rewards.
To differentiate the two types new keywords (trigger|achieve, maintain) would be required, an example would be:

(:rewards
  (achieve  (not (pre 1))  1) ; Get one valuation when (pre 1) becomes false
  (maintain (not (pre 1)) 10) ; Get 10 valuation for each operation that does not change it
)

In the future the reward value could support formulas with a time variable or be limited to win such rewards a limited amount of times.

Model goals for this domain

Alas, my co-authors think we should also have goals here, so we may need to get that working too.

I asked Pankaj to help me with this, let's see how long he takes to reply.

Evaluate probabilistic operators shared preconditions once

Shared preconditions can be optimized to be evaluated only once, which may require modifications in both UHyper_Compiler#compile_domain and Hypertension_U#planning.
This process can be done by:

  • Only evaluating the preconditions during the first outcome evaluation
  • Separating preconditions from operator application (using N + 1 methods)
  • Using coroutines.

May be slower when evaluating a complex precondition before minimum probability!
See Hypertension_U#execute.

Overwrite rewards and attachments in problem

Some problems may require a different usage of rewards and attachments, currently defined in the domain file. Instead of creating a new domain for such cases the user should be able to overwrite or add to each set in the problem file.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.