Menu

newbie- general constraint solver?

2006-10-20
2012-09-14
  • Neal D. Becker

    Neal D. Becker - 2006-10-20

    I don't really know anything about faces-pm. Just wondering. Can this solve general contrained problems? For example, scheduling speakers for rooms at a conference.

     
    • Michael Reithinger

      Here is small example you can try out:

      -- coding: utf-8 --

      from faces import *
      from faces.lib import report
      from faces.lib import gantt
      from faces.lib import resource

      class Room1(Resource):
      pass

      class Room2(Resource):
      pass

      class Room3(Resource):
      pass

      def Scheduling():
      resource = Room1 | Room2 | Room3
      speaker = ""
      start = "2005-1-16"

      def PYHS1():
          title = "Applied Quantum Mechanincs"
          length = "1H"
          speaker = """Schrödinger"""
      
      def PYHS2():
          title = "Relativity And TimeTravelling"
          speaker = "Einstein"
          length = "1H 30M"
      
      
      def PHYS3():
          title = "Freewill and Relativity"
          speaker = "Einstein"
          start = up.PYHS2.end
          length = "1H"
      
      def CPS1():
          title = "Tables are out"
          speaker = "Date"
          length = "1H"
      
      def CPS2():
          title = "The Psychology of an CPU"
          speaker = "weinberg"
          length = "1H"
      

      project = BalancedProject(Scheduling)

      class Gantt(gantt.Standard):
      data = project
      sharex = "share1"

      class Report(report.Standard):
      data = list(project)[1:]

      def make_report(self, data):
          for t in data: 
              yield (t.name, t.title, t.speaker, t.start, t.end, t.booked_resource)
      

      class RoomLoad(resource.Standard):
      data = project
      sharex = "share1"

      def modify_bar(self, bar_widget, row_widget, task):
          bar_widget.text("speaker: %s\n" % task.speaker,
                          LEFT + 2*HSEP, TOP - 2*VSEP,
                          horizontalalignment="left",
                          verticalalignment="top",
                          color="white")
      
       
    • Michael Reithinger

      You can probably do this but keep in mind, faces is a project management tool. Maybe there is a tool in the web, that fits better.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.