Jump to content

Creating a scheduling algorithm with conditions


msaz87

Recommended Posts

Hey all,

 

I'm looking at writing a script to produce a schedule for a flag football league -- but there are some factors I was hoping I could get help with. I don't want to come across like I'm asking someone to write the script for me -- but just point me in the right direction of something that be of use or offer up a suggestion.

 

So here are the details:

- Each league is broken up into X divisions, each with X teams that will play each other over X number of games during X number of dates. Each date has X number of time slots and X number of fields... so for one week, there might be game times at 6:15, 7:00 and 7:45 and games on Field 1, Field 2 and Field 3 for each

- The script would randomly place teams in these slots against a team in their division for each game and then just repeat the order if need be

 

So far to this point it's easy enough and something I've already done... but this is what complicates things and I was looking for some guidance on:

 

- Teams might have requests they make... like Team A can't play games earlier than 7 or Team B can't play later than 9

 

Working in a conditional statement like that is something that throws a wrench into the whole schematic I mapped out in my head...

 

Any help or guidance is really appreciated -- thanks a bunch!

Link to comment
Share on other sites

At the moment I don't have any code for this auto-scheduler... the previous one I wrote was basically a by-hand scheduler. You inputted certain variables, date, number of fields, number of times, etc. and it produced the table structure you filled out -- but this new one takes that a step further by randomly assigning those matchups and doing it for every game over the duration of the league.

 

I know that makes it difficult to provide assistance, but generally I try to work out the concept in my head first before I start coding anything and that's where I'm hitting the block -- not even being able to visualize how I might handle the conditions.

 

I'm going to start to write some things out and see if I can't make a little progress and will post it when I can -- but in the meantime if there's any advice, I'd appreciate it. Thanks!

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.