Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7701827
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T23:05:14+00:00 2026-05-31T23:05:14+00:00

I am making a timetabling program which does one to one matches from SubjectTeacherPeriod

  • 0

I am making a timetabling program which does one to one matches from SubjectTeacherPeriod (planning entity) to Period. There comes a case when I need to: “for y periods, atleast x of the SubjectTeacherPeriod must match a match_condition“

For example, I want to constrain 3 particular periods, atleast two of them to be taught by teachers who match to asst prof.

Here is the data structure holding such a constraint:

Class XOfYPeriods
  SomeType match_condition 
  int x
  List<Period> Periods //problem 

SubjectTeacherPeriod has a Period, of course

class SubjectTeacherPeriod
  int id
  SomeType attrib
  Period period

How do I write a rule that evaluates individual Periods from a list to check if x number of SubjectTeacherPeriods that are allocated those Periods meet the match condition?

Do correct me if I am defining my classes in bad form.

For the sake of example, here is a statement to be evaluated to determine a match: eval(matches($stp_attrib,$match_condition))


Sorry for the use of Pseudocode if it confused more than clarified. The SomeType is actually List< String> and thus the match condition is checked with a Collections.disjoint

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T23:05:15+00:00Added an answer on May 31, 2026 at 11:05 pm

    I will give it a try, but not sure I completely understand your problem statement:

    rule "X of Y Periods"
    when
        $c : XOfYPeriods( )
        $list : List( size > $c.x ) from
            accumulate( $stp : SubjectTeacherPeriod( matches(attrib, $c.match_condition),
                                                     period memberOf $c.periods ),
                        collectList( $stp ) )
    then
        // $list of STP that match the condition and 
        // whose period matches one of the periods in the list
    end
    

    Hope it helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am making a timetabling application. The important classes are: Period id: int clazz:
Making a small WCF test program which is based on a Store that has
Making a simple program which will generate a multiple choice form. I have an
When making a call to jQuery get , how does one specify HTML elements
Making a very basic paint program for a class and one of the requirements
Making an adobe flex ui in which data that is calculated must use proprietary
Making UML sequence diagram in VS 2010RC I've observed that there is no activation
making a new jsp and got a mock-up from some analyst. Notice the sections
Does making a class field volatile prevent all memory visibility issues with it in
making a multi-language site with codeginiter. I have created two folders. One for french

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.