• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Paul Clapham
  • Devaka Cooray
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Tim Moores
  • Carey Brown
  • Mikalai Zaikin
Bartenders:
  • Lou Hamers
  • Piet Souris
  • Frits Walraven

Problem with output JESS NETBEAN

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello es anyone of you knows how to get the result generated by jess and put on a WRITER or view directly on a textArea
I tried too much stuff and it did not work (I'm stuck)

Writer os = new StringWriter();
engine.addOutputRouter("t",os);
System.out.println(os.toString());
os rest empty

private void jButton1ActionPerformed(java.awt.event.ActionEvent evt) {
// TODO add your handling code here:
Rete engine = new Rete();

try {

engine.batch(nom);

engine.executeCommand("(reset)");

engine.executeCommand("(assert (fait mo ))");

Writer os = new StringWriter();
engine.addOutputRouter("t",os);

System.out.println(os.toString());
engine.executeCommand("run");

}
catch (JessException je) {
System.out.println("2:" + je.getMessage());

}
 
There’s no place like 127.0.0.1. But I'll always remember this tiny ad:
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
reply
    Bookmark Topic Watch Topic
  • New Topic