home *** CD-ROM | disk | FTP | other *** search
/ Liren Large Software Subsidy 9 / 09.iso / e / e060 / 7.ddi / TUTOR / REPLANT.RSS < prev    next >
Encoding:
Text File  |  1986-04-10  |  8.8 KB  |  377 lines

  1. /* REPLANT.RSS - Indiana corn replanting advisor        */
  2.  
  3. WINDOW:
  4.     ROW:    18
  5.     COLUMN: 15
  6.     DEPTH:    7
  7.     WIDTH:    50
  8.     FOGC:    Red
  9.  
  10. INITIAL:
  11.     if not indemo then
  12.         load library gdemo    
  13.         indemo = true
  14.         load anykey
  15.     endif
  16.     load rpforms        /* Load in the forms for replant */
  17.     clear
  18.     olddeci = e.deci
  19.     e.deci = 0
  20.         e.auto    = true
  21.     e.lstr    = 70
  22.     e.tryp    = "e"        /* Try premises "eagerly"    */
  23.     e.rigr    = "m"        /* Accept minimal certainties    */
  24.     compact    = unknown
  25.     rain    = unknown
  26.     viable    = unknown
  27.     stand    = unknown
  28.     uniform    = unknown
  29.     pneed    = unknown
  30.     tneed    = unknown
  31.     need    = unknown
  32.     action    = unknown
  33.     date    = unknown
  34.     problem    = unknown
  35.     crusting = unknown
  36.     hardsoil = unknown
  37.     helpsoil = unknown
  38.     putform header
  39.  
  40. GOAL:    action
  41.  
  42. DO:
  43.     putform clearit
  44.     oldlnum = e.lnum
  45.     e.lnum = 3
  46.     test tneed
  47.        case "till":    t="The field needs tillage";break
  48.        case "no till": t="The field does not need tillage";break
  49.     endtest
  50.     test pneed
  51.        case "replant":         r="The field needs replanting";break
  52.        case "partial replant": r="The field needs partial replanting";break
  53.        case "not replant":     r="The field does not need replanting";break
  54.     endtest
  55.     test action
  56.        case "replant":              a="Replant the field";break
  57.        case "partial replant":      a="Replant the damaged areas only";break
  58.        case "not replant":          a="Not replant the field";break
  59.        case "till and replant":     a="Till the field and replant the damaged areas";break
  60.        case "till and not replant": a="Till the field but do not replant";break
  61.     endtest
  62.  
  63.     at 8,10 ?"Given the factors:"
  64.     at 10,19 ?"1) The date is ",date
  65.     if known("tneed") then
  66.         at 11,19 ?"2) ",t," (certainty ",hicf(tneed),")"
  67.     endif
  68.     if known("pneed") then
  69.         at 12,19 ?"3) ",r," (certainty ",hicf(pneed),")"
  70.     endif
  71.     at 14,10 ?"The best course of action is to:"    
  72.     at 16,19 ?a,", (certainty ",hicf(action),")"
  73.     at 22,1
  74.     e.lnum = oldlnum
  75.     e.deci = olddeci
  76.  
  77. RULE:    R1
  78.     PRIORITY: 20
  79.     COST: 20
  80.     IF:    compact = true or crusting  = true
  81.     THEN:    hardsoil = true
  82.     REASON:    If the soil is compacted or crusted, then the
  83.          soil is hard.
  84.     COMMENT: Determine if the soil is hard. 
  85.  
  86.  
  87. RULE:    R2
  88.     PRIORITY: 20
  89.     COST: 20
  90.     IF:    compact = false and crusting = false
  91.     THEN:    hardsoil = false
  92.     REASON:    If the soil is not compacted and not crusted,
  93.          then the soil is not hard.
  94.     COMMENT: Determine if the soil is not hard.
  95.  
  96.  
  97. RULE:    R3
  98.     PRIORITY: 20
  99.     COST: 20
  100.     IF:    hardsoil = true and rain = false
  101.     THEN:    helpsoil = true
  102.     REASON:    If the soil is hard and there is little rain in
  103.          the forecast, then the soil will need to be
  104.          softened.
  105.     COMMENT: Determine if the soil needs help to soften it.
  106.  
  107.  
  108. RULE:    R4
  109.     PRIORITY: 20
  110.     COST: 20
  111.     IF:    hardsoil = false or rain = true
  112.     THEN:    helpsoil = false
  113.     REASON:    If the soil is not hard, or there is more than a
  114.          little rain in the forecast, then the soil does
  115.          not need to be softened.
  116.     COMMENT: Determine if the soil does not need help being
  117.          softened.
  118.  
  119.  
  120. RULE:    R5
  121.     PRIORITY: 20
  122.     COST: 20
  123.     IF:    helpsoil = true and stand <= 12000 and problem = false
  124.     THEN:    tneed = "till"     
  125.     NEEDS:    helpsoil 
  126.         stand
  127.         problem
  128.     REASON:    If the soil needs to be softened, and the stand
  129.          is less than 12000 plants per acre, then the
  130.          field needs tilled with a rotary hoe.    
  131.     COMMENT: Determine if tillage is needed.           
  132.  
  133. RULE:    R6
  134.     PRIORITY: 20
  135.     COST: 20
  136.     IF:    helpsoil = false or stand > 12000 or problem = true
  137.     THEN:    tneed = "no till"   
  138.     NEEDS:    helpsoil
  139.         stand
  140.         problem
  141.     REASON:    If the soil does not need to be softened, or the
  142.          stand is better than 12000 plants per acre, then
  143.          tillage with a rotary hoe is not needed.  
  144.     COMMENT: Determine if no tillage is needed.       
  145.  
  146.  
  147. RULE:    R7
  148.     PRIORITY: 20
  149.     COST: 20
  150.     IF:    viable = true or stand > 16000 or problem = true 
  151.     THEN:    pneed = "not replant"  
  152.     NEEDS:    viable
  153.         stand
  154.         problem
  155.     REASON:    If there are viable seeds in the field, or the
  156.          stand is better than 16000 plants per acre, then
  157.          the field does not need replanting.  
  158.     COMMENT: Determine what kind of plantin       
  159.  
  160. RULE:    R8
  161.     PRIORITY: 20
  162.     COST: 20
  163.     IF:    viable = false and (uniform = true or stand < 12000) and problem = false
  164.     THEN:    pneed = "replant"  
  165.     NEEDS:    viable
  166.         uniform
  167.         stand
  168.         problem
  169.     REASON:    If there are no viable seeds remaining in the
  170.          field, and there is either uniform thinning or a
  171.          stand worse than 12000 plants per acre, then the
  172.          field needs to be replanted.  
  173.     COMMENT: Determine if the field needs replanting.      
  174.  
  175. RULE:    R9
  176.     PRIORITY: 20
  177.     COST: 20
  178.     IF:    viable = false and uniform = false and problem = false
  179.     THEN:    pneed = "partial replant"  
  180.     REASON:    If there are no viable seeds in the field, and
  181.          there is not a uniform thinning of the plants,
  182.          then the field needs to be partially replanted. 
  183.     COMMENT: Determine if the field needs to be partially
  184.          replanted.    
  185.  
  186.  
  187.  
  188. RULE:    R10
  189.     PRIORITY: 20
  190.     COST: 20
  191.     IF:    date > "06/10"
  192.     THEN:    action = "not replant" 
  193.     REASON:    If it is past June 10th, then no tilling or
  194.          replanting should be done. 
  195.     COMMENT: If it is late in the season, then there is
  196.          nothing to do   
  197.  
  198.  
  199. RULE:    R11
  200.     PRIORITY: 20
  201.     COST: 20
  202.     IF:    date > "05/25" and tneed = "no till" 
  203.     THEN:    action = "not replant" 
  204.     NEEDS:    date
  205.         tneed
  206.     REASON:    If it is after May 25th and no tillage is needed,
  207.          then nothing should be done. 
  208.     COMMENT: If after May 25th, we might be able to till   
  209.  
  210.  
  211. RULE:    R12
  212.     PRIORITY: 20
  213.     COST: 20
  214.     IF:    pneed = "not replant" and tneed = "no till" 
  215.     THEN:    action = "not replant" 
  216.     NEEDS:    pneed
  217.         tneed
  218.     REASON:    If the field does not need replanting, and
  219.          tillage is not needed, then do nothing. 
  220.     COMMENT: Determine if nothing needs to be done at all.   
  221.  
  222.  
  223. RULE:    R13
  224.     PRIORITY: 20
  225.     COST: 20
  226.     IF:    date <= "06/10" and tneed = "till" and pneed = "not replant"
  227.     THEN:    action = "till and not replant" 
  228.     NEEDS:    date
  229.         tneed
  230.         pneed
  231.     REASON:    If it is before June 11th and the field needs
  232.          tillage but not replanting, then till but do not
  233.          replant. 
  234.     COMMENT: Determine if tillage is needed without
  235.          replanting.    
  236.  
  237.  
  238. RULE:    R14
  239.     PRIORITY: 20
  240.     COST: 20
  241.     IF:    date > "05/25" and date <= "06/10" and tneed = "till"
  242.     THEN:    action = "till and not replant" 
  243.     NEEDS:    date
  244.         tneed
  245.     REASON:    If it after May 25th and before June 11th, and
  246.          the ground needs tillage, then till but do not
  247.          replant.   
  248.  
  249.  
  250. RULE:    R15
  251.     PRIORITY: 20
  252.     COST: 20
  253.     IF:    date <= "05/25" and tneed = "till" and (pneed = "replant" or pneed = "partial replant")
  254.     THEN:    action = "till and replant" 
  255.     NEEDS:    date
  256.         tneed
  257.         pneed
  258.     REASON:    If it is May 25th or earlier, and the field needs
  259.          tillage and replanting, then till and replant.  
  260.          
  261.  
  262.  
  263. RULE:    R16
  264.     PRIORITY: 20
  265.     COST: 20
  266.     IF:    date <= "05/25" and tneed = "no till" and pneed = "partial replant"
  267.     THEN:    action = "partial replant" 
  268.     NEEDS:    date
  269.         tneed
  270.         pneed
  271.     REASON:    If it is May 25th or earlier, and the field does
  272.          not need tillage but needs partial replanting,
  273.          then partially replant.   
  274.  
  275.  
  276. RULE:    R17
  277.     PRIORITY: 20
  278.     COST: 20
  279.     IF:    date > "05/15" and tneed = "no till" and pneed = "replant"
  280.     THEN:    action = "not replant" 
  281.     NEEDS:    date
  282.         tneed
  283.         pneed
  284.     REASON:    If it is after May 15th and the field does not
  285.          need tillage but it needs replanting, then do
  286.          not replant.   
  287.  
  288.  
  289. RULE:    R18
  290.     PRIORITY: 20
  291.     COST: 20
  292.     IF:    date <= "05/15" and tneed = "no till" and pneed = "replant"
  293.     THEN:    action = "replant" 
  294.     NEEDS:    date tneed pneed
  295.     REASON:    If it is May 15th or earlier and the field needs
  296.          replanting but not tillage, then replant.  
  297.  
  298. VARIABLE:    COMPACT
  299.     LABEL:    The field shows compaction 
  300.     FIND:     putform fcomp
  301.         perform asktf
  302.         compact = ans cf anscf
  303.  
  304.  
  305. VARIABLE:    CRUSTING
  306.     LABEL:    The field shows crusting 
  307.     FIND:     putform fcrus
  308.         perform asktf
  309.         crusting = ans cf anscf
  310.  
  311.  
  312. VARIABLE:    HARDSOIL
  313.     LABEL:    The soil is hard
  314.  
  315.  
  316. VARIABLE:    RAIN
  317.     LABEL:    There is significant rain in the forecast
  318.     FIND:     putform frain
  319.         perform asktf
  320.         rain = ans cf anscf
  321.  
  322.  
  323. VARIABLE:    HELPSOIL
  324.     LABEL:    The soil needs to be softened
  325.  
  326.  
  327. VARIABLE:    TNEED
  328.     LABEL:    Tillage needed
  329.  
  330.  
  331. VARIABLE:    PNEED
  332.     LABEL:    Planting needed
  333.  
  334.  
  335. VARIABLE:    VIABLE
  336.     LABEL:    Viable seeds remain
  337.     FIND:     putform fviab
  338.         perform asktf
  339.         viable = ans cf anscf
  340.  
  341.  
  342. VARIABLE:    UNIFORM
  343.     LABEL:    There is uniform thinning of plants
  344.     FIND:     putform funif
  345.         perform asktf
  346.         uniform = ans cf anscf
  347.  
  348.  
  349. VARIABLE:    STAND
  350.     LABEL:    Plants per acre in the stand
  351.     FIND:    ans = 0
  352.         putform fstan
  353.         getform fstan
  354.         stand = ans
  355.         putform clearit
  356.  
  357.  
  358. VARIABLE:    DATE
  359.     LABEL:    Today's date
  360.     FIND:    ans = " "
  361.         putform fdate
  362.         getform fdate
  363.         date = ans
  364.         putform clearit
  365.  
  366.  
  367. VARIABLE:    PROBLEM
  368.     LABEL:    Chemical or pest problems
  369.     FIND:     putform fprob
  370.         perform asktf
  371.         problem = ans cf anscf
  372.  
  373. VARIABLE:    ACTION
  374.     LABEL:    The action recommended
  375.  
  376. END:
  377.