and the python program below
def fc_test():
print 70"="
print '%-s %s %s' % (25, "Species", 25, "Technology", 18, "Effectiveness(%)")
engine.reset() # Allows us to run tests multiple times.
engine.activate('fc_decon') # Runs all applicable forward-chaining rules.
print 70*"="
print
print "done."
When I run the program, everything works fine. However, I would like to move the python code in the rules to the python program, to get the asserted variables in treatment_species_is(....) and have them printed from the main python program.
Any help will be greatly appreciated.
Thanks,
Oubeid
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi,
I am new to PyKE and Python and would like some help. This may be a stupid question.
I have the rule below
treatment_species
foreach
decon2.contaminant_found_is($species, $conc)
decon2.treatment_technology_effectiveness_is($technology, $species, $effect, $nodette)
decon2.minimum_treatment_effectiveness_is($target_level, $nodemte)
check $target_level <= $effect
assert
decon2.treatment_species_is($technology, $species, $effect, $nodette)
python print 70"-"
python print '%-s %s %s' % (30, $species, 25, $technology, 10, $effect)
and the python program below
def fc_test():
print 70"="
print '%-s %s %s' % (25, "Species", 25, "Technology", 18, "Effectiveness(%)")
engine.reset() # Allows us to run tests multiple times.
engine.activate('fc_decon') # Runs all applicable forward-chaining rules.
When I run the program, everything works fine. However, I would like to move the python code in the rules to the python program, to get the asserted variables in treatment_species_is(....) and have them printed from the main python program.
Any help will be greatly appreciated.
Thanks,
Oubeid
I figured it out.
Thanks.