12.07.2015 Views

flex Examples - LPIS

flex Examples - LPIS

flex Examples - LPIS

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

38 Flex Example Listings% teacher and period is undone when no more teachers can be proposed% for the remaining classes and periodsrelation backward_chain_timetableif class C needs timetabling for period Pand !and T can definitely teach S to class C during period Pand remember that class C is taught S by T during period Pand backward_chain_timetable .relation backward_chain_timetable .% this action lets you select the forward or backward chaining solution.action timetable ;do ask timetable_methodand write( 'Thinking ...' )and nland if the answer to timetable_method is 'forward chaining solution'then do forward_chaining_timetableelse do backward_chaining_timetableend if .% this action initiates the backward chaining solution.action backward_chaining_timetable ;do restartand backward_chain_timetableand print_table .% this action initiates the forward chaining solution.action forward_chaining_timetable ;do restartand invoke ruleset forward_chaining_timetableand print_table .question timetable_methodWhich method ? ;choose one of 'forward chaining solution','backward chaining solution' .% this action prints the final timetable solutionaction print_table ;for every C is some classdo write( class(C) )and nland for every P is some periodanddo write( period(P,S,T) )and nlend forand nlend for .class C is taught S by T during period PA Guide to the Flex Expert System Toolkit

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!