Re: finding optimal pairs/triplets

2015-10-07 Thread Kurt Sys
Yes! That's what I was looking for :). I really like the idea of 'team-centric' and 'player-centric', and combining them! It might take me some time to figure it all out in detail, but with this idea and your example, I'll pretty confident I'll get there :). I could go for heuristics as well, b

Re: finding optimal pairs/triplets

2015-10-06 Thread Kurt Sys
Allright, makes sense... I must have mist the 'integer only' for all expressions (including $nth). Using 'map' seems to be doing what I expect (at first sight). Thx! Op woensdag 7 oktober 2015 05:50:37 UTC+2 schreef Alex Engelberg: > > Loco's constraints and expressions only work on integers,

Re: finding optimal pairs/triplets

2015-10-06 Thread Mark Engelberg
Here is my Loco-based solution to the team-splitting problem: https://gist.github.com/Engelberg/d8007588ce5a83fd0303 There is a whole art to building constraint programming models. I know the basics, but I'm not an expert, and your model sounds fairly complicated. So I'm not sure I can answer all

Re: finding optimal pairs/triplets

2015-10-06 Thread Alex Engelberg
Loco's constraints and expressions only work on integers, so unfortunately $nth can't handle maps in a list. $nth takes either a list of Loco expressions or a list of integers. To get the nth player level, you could try: ($nth (map :level players) [:p 0 0]) Also, I should mention that all Loco

Re: finding optimal pairs/triplets

2015-10-06 Thread Kurt Sys
So, the basic idea is to construct a matrix like this: spot1 spot2 spot3 team1 5 0 -1 team2 4 1 -1 ... With the 'spots' the spaces to fill in for each team. There are max 3 spots/team. If a spot is not used, -1 should be put. If it is used, I put the nu