How to group students with optional course?

Started by zt3, July 17, 2016, 08:21:06 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Liviu Lalescu


zt3

Quote from: Liviu Lalescu on August 02, 2016, 03:28:26 PM

Add some rooms as courses and other rooms as real rooms. In the rooms list, add both, maybe with names to differentiate, like courses start with "C" and real rooms with "R". Then add some activities to be placed in "R" rooms and maybe constrain them to be at the same time as the courses activities.

I am a little confused. The activities are all preferred being placed in "C" rooms now. When "R" rooms are added, a activity should be placed both in a "C" room and "R" room. How to make the constraints? 
To make it clear, I just modified the example fet of the custom version as an example:
1. removed most of the students and just kept two;
2. removed most of the teachers, and make two teachers teach the same subject 151-Biology;
3. removed all the other activities and constraints that are not related to the kept students and teachers.
4. add a real room to the Rooms_List (line 429)

I do not know what to do next. Could you show me how to make it with the example file please? Thanks.

Liviu Lalescu

OK, it's good that you made a small file (which I needed to correct). I was able to make a real room. See the attached. See the same starting time constraints.

Note: I think you don't need the same starting hour constraints. jimmyjim needed these.

zt3

#18
Thank you for your corrections.
Now I see the trick. :)

You add a ConstraintSubjectPreferredRoom at the end of fet file:
<ConstraintSubjectPreferredRoom>
   <Weight_Percentage>100</Weight_Percentage>
   <Subject>151-Biology-Real Room</Subject>
   <Room>Real Room 1</Room>
   <Active>true</Active>
   <Comments></Comments>
</ConstraintSubjectPreferredRoom>

In reality, there are many real rooms that are suitable for many subjects/activities.
Therefore I should add ConstraintSubjectPreferredRoom like this:
<ConstraintSubjectPreferredRooms>
   <Weight_Percentage>100</Weight_Percentage>
   <Subject>151-Biology-Real Room</Subject>
   <Number_of_Preferred_Rooms>20</Number_of_Preferred_Rooms>
   <Preferred_Room>Real Room 1</Preferred_Room>
   <Preferred_Room>Real Room 2</Preferred_Room>
        ......
   <Active>true</Active>
   <Comments></Comments>
</ConstraintSubjectPreferredRooms>
<ConstraintSubjectPreferredRooms>
   <Weight_Percentage>100</Weight_Percentage>
   <Subject>255-Life Science-Real Room</Subject>
   <Number_of_Preferred_Rooms>20</Number_of_Preferred_Rooms>
   <Preferred_Room>Real Room 1</Preferred_Room>
   <Preferred_Room>Real Room 2</Preferred_Room>
        ......
   <Active>true</Active>
   <Comments></Comments>
</ConstraintSubjectPreferredRooms>

Am I right?

Would some (of 5) 151-Biology-Real Room activities take place in Real Room 1, while some in Real Room 2?
(by the way, this is acceptable. In fact, sometimes this is preferred in my school)

Liviu Lalescu

Quote from: zt3 on August 04, 2016, 05:15:52 AM
Am I right?

Would some (of 5) 151-Biology-Real Room activities take place in Real Room 1, while some in Real Room 2?
(by the way, this is acceptable. In fact, sometimes this is preferred in my school)

I think the answer is yes.

If you would like all (5) activities in the same room (which you don't want), you could use constraint activities occupy max 1 different rooms.

zt3

#20
OK, I see.

If I do not use constraint activities occupy max 1 different rooms (I mean no "ConstraintActivitiesOccupyMaxDifferentRooms" tags at all), would they occupy many rooms by default?

Meanwhile, I think I should not use "ConstraintRoomMaxOccupiedSlots" on Real Rooms (see your corrected-file at line 806), since I do not know which activities will take place in which real rooms.

Can I use "ConstraintSubjectPreferredRooms" (with 's' at the end) tag instead of "ConstraintSubjectPreferredRoom" when there is only one preferred room?

I also wonder what is the usage of Activity_Group_Id, since it is not fully used in the example fet file.

Liviu Lalescu

Quote from: zt3 on August 04, 2016, 01:26:04 PM
OK, I see.
If I do not use constraint activities occupy max 1 different rooms (I mean no "ConstraintActivitiesOccupyMaxDifferentRooms" tags at all), would they occupy many rooms by default?


Yes.

Quote

I also wonder what is the usage of Activity_Group_Id, since it is not fully used in the example fet file.

It has the same role as in the official FET, to group activities when you add activities split into more components per week. You can go without them, but when it is logical to have them, it is better to have them. Add in a file two activities and an activity split into two and see the difference.


Liviu Lalescu

Quote from: zt3 on August 04, 2016, 01:26:04 PM
Meanwhile, I think I should not use "ConstraintRoomMaxOccupiedSlots" on Real Rooms (see your corrected-file at line 806), since I do not know which activities will take place in which real rooms.

Yes, indeed, I forgot.

PS: Sometimes (like this time) it is better to post a new reply instead of modifying the old one, or send me a PM to re-read the post.

Liviu Lalescu

Quote from: zt3 on August 04, 2016, 01:26:04 PM
Can I use "ConstraintSubjectPreferredRooms" (with 's' at the end) tag instead of "ConstraintSubjectPreferredRoom" when there is only one preferred room?

Unfortunately, this is possible only from FET-5.24.0 upwards, so you cannot in FET-5.22.0-mapr.

zt3

Yes, I should post a new reply.

Quote from: Liviu Lalescu on August 04, 2016, 02:23:39 PM
Quote from: zt3 on August 04, 2016, 01:26:04 PM
Can I use "ConstraintSubjectPreferredRooms" (with 's' at the end) tag instead of "ConstraintSubjectPreferredRoom" when there is only one preferred room?

Unfortunately, this is possible only from FET-5.24.0 upwards, so you cannot in FET-5.22.0-mapr.


Sad to hear that. :(
Do you use any version systems (like git)?
I think it is good for managing all the versions, and maybe I can help you to upgrade mapr version.
I really like FET, and I hope I can make some contribution.   

By the way, what about "ConstraintMinDaysBetweenActivities" or "ConstraintActivitiesOccupyMaxDifferentRooms"? Can I still add such a contraint when the "Number_of_Activities" inside is 1?


Liviu Lalescu

Quote from: zt3 on August 05, 2016, 04:09:54 AM
Do you use any version systems (like git)?
I think it is good for managing all the versions, and maybe I can help you to upgrade mapr version.
I really like FET, and I hope I can make some contribution.   


No, I don't use, I don't know it.

Quote

By the way, what about "ConstraintMinDaysBetweenActivities" or "ConstraintActivitiesOccupyMaxDifferentRooms"? Can I still add such a contraint when the "Number_of_Activities" inside is 1?

You can add min days and max different rooms to any set of activities, but it has to be more than 1 activity.

zt3

#26
Quote from: Liviu Lalescu on August 05, 2016, 07:29:31 AM

No, I don't use, I don't know it.


Well, just a suggestion.

Quote from: Liviu Lalescu on August 05, 2016, 07:29:31 AM

You can add min days and max different rooms to any set of activities, but it has to be more than 1 activity.


Yes, I created a fet file, and the software just reports the "1 actiivity" error. :)
I solved it. But it then reports another error with my fet file (attached):
Quote
Cannot generate timetable, because for activity with id==10446 you have no allowed preferred room (from preferred room(s) constraints). This means that a constraint preferred room(s) has 0 rooms in it. This should not happen. Please report possible bug.
I checked the fet file.
Activity 10446 is related to Subject "Political_2".
So I searched this subject, and find at line 500:
<ConstraintSubjectPreferredRooms>
<Weight_Percentage>100</Weight_Percentage>
<Subject>Political_2</Subject>
<Number_of_Preferred_Rooms>2</Number_of_Preferred_Rooms>
<Preferred_Room>Political_2-T1</Preferred_Room>
<Preferred_Room>Political_2-T2</Preferred_Room>
<Active>true</Active>
</ConstraintSubjectPreferredRooms>

It has the preferred rooms.
I can not figure out how to solve the problem.

Liviu Lalescu

About the repository thing: I am so sorry. I appreciate your good intentions, but I do not know how to use repository. And I prefer to be in full control. The contributions are to be supervised by me.

To update mapr to the latest FET would be a titanic job.

About your file: the preferred rooms and the next constraints, preferred room (which by the way is duplicated) - they are impossible. The rooms for this subject is the intersection of all the rooms, which is void. You might want to add another subject, like I did in the provided file above (it is a fake subject, check that carefully).

zt3

About the repository thing:
Yes, I really like FET. Without repository commits history, it is a difficult job to update mapr.
You can use github (http://github.com), and you can still supervise all the pull requests (someone who wants to contribute some code).
I think the benefit is huge.
Anyway, it is up to you. :)
And I will try my best to make contribution.

About my fet file:
Once I posted it, I realized maybe I made a mistake.
And yes, you are right. I solved it. Thanks.

Liviu Lalescu

Thank you for your kind words!

I added a new custom version, with a minor change, which permits to solve zt3's files. Please see the Custom page of the FET homepage ( http://lalescu.ro/liviu/fet/custom.html ).