allocating jobs to people based upon choice?

  • Thread starter Thread starter Howard
  • Start date Start date
H

Howard

I'm trying to build a system that has a table of possible jobs and a table
of students
Each student can choose 6 jobs in order of preference
I allocate a student to a job based upon their prefence (and a few other
parameters to do with the siutablility of the job.

Qn.
I'm sure I've seen some sample code that will automatically allocate one
thing to another giving the best fit.
Anyone know where or can point me in the right direction.

I guess this is pretty much the same code as you woul duse in a dating
agency
Howard
 
Howard,
This is not hard conceptually, but a little tricky in execution. First, you
will need to make some business rules decisions. Here are some of the issues
you need to address before you can get to the code. You may have already
done this, but to help, we would need to know:
1. Are there a limited number of jobs? Say 25 students have chosen the same
job as their first choice. Can they all have it, or are there say only 3
jobs available?
2. If the jobs are limited, how will you rank the students?
3. How will you rank the jobs? Say there are 25 identical jobs available
and 3 students each choose them. Which 3 of the jobs get filled?
4. If 3 students want the same job and one is assigned the job, then does
student 2 get his second choice.

Before you start coding, write down the business rules. If you like, post
then, and we can go from there.

Good Luck.
 
Thanks Klatuu,

I've interspersed my replies with the questions

Klatuu said:
Howard,
This is not hard conceptually, but a little tricky in execution. First,
you
will need to make some business rules decisions. Here are some of the
issues
you need to address before you can get to the code. You may have already
done this, but to help, we would need to know:

1. Are there a limited number of jobs? Say 25 students have chosen the
same
job as their first choice. Can they all have it, or are there say only 3
jobs available?

Ans. Most jobs only accept one student but a few may take 2, exceptionally
3. How many students they can take is one of the fields in the jobs table
2. If the jobs are limited, how will you rank the students?

Ans. Tricky, Initially on the chioce ranking by the students so I would
allocate a job to a students who put it down as a first choice rather than a
second choice. But the jobs table holds the location of the jobs and the
students have to say where they can get to easily. So second cut would be
not to offer a job if they can't get there. (I am thinling of changing the
choice method so that instead students ranking each job choice 1 - 6 , each
job choice would be ranked as 'really would like this one', 'Don't mind
doing this one', 'Ill do this one if I have too' so that there can be more
than one first choice so to speak.
3. How will you rank the jobs? Say there are 25 identical jobs available
and 3 students each choose them. Which 3 of the jobs get filled?
Ans. Each job is with a different employer (excpt for the ones that offer to
take 2 or three students) so the stiudents perceive them as different jobs.
Although they may be of the same type e.g. classroom assistant. If all other
parameters, i.e. preference, location etc are equal then I would offer in
the order the job appears in the job file.
(Although in practice there is usualy more students than the available jobs
so the problem does not arise and we have to scrabble around trying to
invent jobs within out own institution.)
Numbers are around 350 students and about 300 available jobs - some students
find their own placements and so are not part of the system.
4. If 3 students want the same job and one is assigned the job, then does
student 2 get his second choice.

Ans. As far as possible that is what happens at the moment (by hand)
although it is difficult to keep track so the last students to be processed
often don't get any of their choices and end up with something noboby else
wants. See also comment under (2) above to make choice ranking more
flexible.


Hope this helps
BTW I am reasonably profficient in Access and can write code in VB etc,
having taught these for some years. My PhD is in AI so I was even light
heartedly investigating using a genetic algorithm to maximise student
happiness! So I'm not asking as a newbie but I really need some ideas to
move forward. I'm guessing the table structures will relatively simple and
most of the work will be done in code.

Thaks for your assistance

Howard
 
Ok. heres my take on the solution.

1st, program a loop the runs thru all the jobs and programmatically creates
a table named after each job and populate that table with all students that
meet the 1st round criteria.

then loop thru those tables recordsets and if there are more students then
job openings then programmatically run a delete query that deletes the
students who dont match the 2nd round criteria and again, if more students
than jobs, delete query for 3rd round and 4th round until you get to just 1
student left in the recordset for that job. if you run out of criteria
before running out of students then you might have to append a record to
the end of that recordset that says "too many students" or something that
can later be used in a loop, a dlookup and a listbox to get a list of all
tables(and since the tables are named after jobs, thus getting a list of
jobs) that have a record in the table that says "too many students" so you
know what jobs will require a human touch to determine. and then proceed
thru your loop to apply that delete/append query technique to all the
tables, thus applying to all the jobs.
 
Thank you, I hadn't thought of generating 300 odd tables, one for each job.
I was trying to devise a sort of three dimensional table. This gets round
that problem.

Could you possibly post the code that I would need to populate a list box
with table names as opposed to records from within a table.
Thanks
Howard
 
Its OK Kelly, I've sorted listing the tables now. (BIG problems with
references / DAO / ADO
Howard
 
Back
Top