Now that I have Associated Nodes working, I'd like to take the results and schedule meetings between the two parties represented by the node types, in order of preference according to the score generated by Assocated Nodes. Any suggestions? The algorithm I'm thinking of is something like this:
Create two arrays:
1 - matches[type1][type2] with type2 sorted by score, use this as a stack
2 - meetings[type2][slot], to be populated
Each node of type 1 is supposed to get 6 meetings with a matching type2 out of 12 slots
for meeting = 1 to 6
for each type1
for each session
if meetings[matches[type1][0]][session] is empty, meetings[matches[type1][0]] == array_pop(matches[type1])
exit to next type1
else next session
end session loop
end type loop
end meeting loop
Any suggestions of modules that might offer some of this functionality? It seems to me that it could be generally useful for scheduling classes to rooms, students to classes, patrons to tables, etc.
Comments
Comment #1
jfberroyer commentedI'm not sure to understand everything, but I think your needs (scheduling classes to rooms, students to classes, patrons to tables, etc.) suppose to associate nodes of a type with nodes of an other type, but with Associated Nodes you can only associate nodes of type A or B with nodes of type A or B (and not associate node of type A only with nodes of type B only). This should be a feature in a next release because the applications you describe sound really interesting.
Comment #2
emdalton commentedI figured out how to only associate type A with type B, not A and B, by creating an invisible field containing the content type, and creating a negative association for that field. The part I still haven't figured out is the scheduling. I have the algorithm, and I've been tinkering around with trying to figure out how to implement it in PHP, but I haven't got it working yet. I'm by no means a PHP expert, let alone fluent in Drupal API. Here's what I was working on, in case you find it at all helpful: