tpaviot / ProcessScheduler

A Python package for automatic and optimized resource scheduling
https://processscheduler.github.io/
GNU General Public License v3.0
59 stars 18 forks source link

Question: Will the optional apply when used with logic operators? #12

Closed dreinon closed 3 years ago

dreinon commented 3 years ago

I'm using the following structure:

for i in range(num_practices_double):
        practice_num += 1
        students_tasks.append(ps.FixedDurationTask(f'{stud_id}__{practice_num}', duration=2, priority = (21 - i),optional=True))
        students_tasks[-1].add_required_resource(Car)
        av_list = []
        for j in availability:
            av_list.append(ps.and_([ps.TaskStartAfterLax(students_tasks[-1], j[0],optional=True), ps.TaskEndBeforeLax(students_tasks[-1], j[1],optional=True)]))
        constraints.append(ps.ForceApplyNOptionalConstraints(av_list,1))

What I want to be optional is the constraint made by the and operator, I mean, the options would be, for example:

So I imagine something like ps.and_(logic, optional=true).

Thank you again :)

tpaviot commented 3 years ago

hmm, I don't know :smile: Just try, it might work

dreinon commented 3 years ago

Solved in issue #13