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.

34 Flex Example Listingsstrategy components. It has similar charactersistics to resourceallocation, scheduling and planning in general.The timetable example is presented as a choice between two contrastingforward and backward chaining solutions. To run the example enter thefollowing goal at the command line:?- timetable.In this example we have some data that represents a number ofteachers, classes, subjects and periods. The teachers can teachcertain subjects and classes and have periods of freetime where theyare unavailable to teach.Given this data, the basic requirement is to schedule a daily teachingrota such that:i. A teacher can only one class during a given period.ii. A class is taught a subject once only per day.This example compares two contrasting methods for implementing atimetable given the above constraints. Both methods attempt to fillthe timetable as much as possible by suggesting teachers that canteach a subject to a given class during a given period. This oftenleads to a situation where there is a partially filled timetable,where no more teachers and subjects can be given for the remainingclasses and periods without conflicts arising.The two methods differ in how they deal with this deadlock.Forward-chaining----------------This is the most efficient method, though there is no guarantee thata potentially existing solution will always be found.In this approach conflicts are resolved by either swapping previouslyassigned teachers or previously assigned subjects. In this wayconflicts are resolved directly when they arise.Backward-chaining-----------------This is less efficient than forward-chaining but if a solution existsthen this approach will eventually get there.In this approach conflicts are resolved by blindly undoing the lastteacher and subject allocated, replacing them with some alternative,and then attempting to fill out the rest of the timetable.If this new allocation does not lead to a solution then this processis repeated until all teacher - subject combinations have beenexhausted.One problem with this method is that the very first teacher, class,subject and period allocated may prevent a solution from being found,yet this method will try all the possible solutions based on thisfirst allocation before rejecting it and trying an alternative.A Guide to the Flex Expert System Toolkit

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

Saved successfully!

Ooh no, something went wrong!