2014-11-22 2 views
0

저는 Optaplanner를 사용하여 터키의 아타튀르크 대학 (Ataturk University)에서 자동 시간대 소프트웨어를 개발하고 있습니다. Optalanner는 모든 요구 사항을 충족 시켰습니다. 그러나 몇 가지 요구 사항이 있습니다. 그들 중 하나 : -> 내가 시간표에 코스를 올리길 원한다면 어떻게 2 개의 순차적으로 배열 할 수 있습니까? 그리고 3 개의 연속적인 기간에있는 강의가 있으면 안된다. 예를 들어 3 시간 수학 수업을 고려 :Opta Planner 어떻게 2 강의 순차 강의를 수강 할 수 있습니까?

     IN MONDAY 
     ----------------------------------------------- 

     0.P  Math    Math   Math 

     1.P  Math    Math   Another 

     2.P  Another   Math   Another 

     3.P  Another   Another  Math 

     4.P  Math    Another  Another 
     (or another day) 
     5.P  Another   Another  Another 

     6.P  Another   Another  Math 
       -----    -----   ----- 
      CORRECT   WRONG   WRONG 

내 시간표는 첫 번째 열처럼되고 싶어하고 나는 다른 경우를 방지 할 필요가있다. 이 같은

답변

0

뭔가 작업을해야합니다 :

rule "twoInARowIsgood" 
when 
    CourseSequentialRequirement($c : course) 
    Lecture (course == $c, $firstP : period) 
    Lecture (course == $c, period.isImmediatlyAfter($firstP)) 
then 
    scoreHolder.add...(kcontext, 100); // Positive constraint 
end 

rule "threeInARowIsBad" 
when 
    CourseSequentialRequirement($c : course) 
    Lecture (course == $c, $firstP : period) 
    Lecture (course == $c, period.isImmediatlyAfter($firstP), $secondP : period) 
    Lecture (course == $c, period.isImmediatlyAfter($secondP)) 
then 
    scoreHolder.add...(kcontext, -500); // Negative constraint and higher than twice the positive one 
end 
+0

감사 제프리를. –