Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Custom Constraints (Functions) returning UNDEFINED #7

Open
robbymichael1 opened this issue Oct 7, 2019 · 1 comment
Open

Custom Constraints (Functions) returning UNDEFINED #7

robbymichael1 opened this issue Oct 7, 2019 · 1 comment

Comments

@robbymichael1
Copy link

When I pass constraints like this:

const constraints = [ //list of non overlapping constraints
['Tennis', 'Climbing'],
['Handstands', 'Climbing'],
['Trapeze', 'Tennis'],
['Tennis', 'Handstands', 'Trapeze']
]

All works fine. But if I pass functions, like this:

const constraints = [ //list of non overlapping constraints
['Tennis', 'Climbing'],
['Handstands', 'Climbing'],
['Trapeze', 'Tennis'],
['Tennis', 'Handstands', 'Trapeze'],
(timetable) => timetable['8:00'].indexOf('Climbing') !== -1 ? ['Climbing'] : [],
(timetable) => timetable['10:00'].indexOf('Tennis') !== -1 ? ['Climbing'] : [],
(timetable) => timetable['9:00'].indexOf('Trapeze') !== -1 ? ['Climbing'] : []
]

I have several "undefined" allocated in the slots.

Of course, the values are differents, this is a example.
I have 200+ constraints.
If I use just the arrays constraints, all works fine.

Any Idea?

@SRSaddler
Copy link

@robbymichael1 did you ever figure this out?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants