Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 3912 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

Let me first preface this by saying I am by no means an expert on Filemaker, more an enthusiast looking to save my small regional field hockey facility from purchasing an expensive shrink wrapped package.

 

So...

After searching high and low for a way in which to generate a sports leagues fixture, by using a combination of Custom Functions, Calculations and Scripting.  I've also been working on my own to generate something that will get me closer to my goal.

 

This forum post is VERY close, but I've come up with a few things that make for a little more flexibility.  Also, the solution posted by Eos has an issue with calculating the fixtures for a league that has an odd number of teams.  That being said some points within this solution have been invaluable in getting my solution to where it currently is, so a very big thanks to Eos for his assistance previously.

 

Onto my solution... Posted Here

 

There are two issues at this stage, no doubt more will pop up...

 

1) The Match List, which utilises a CF called UnorderedPairs found on Brian Dunning's site, is sequential meaning all the 1 | x values are generated first, and then the 2 | x values and so on... Instead the combinations need to come out in a series that allows each team to play only once, and balances the distribution of the fixtures over the time slots available during the season. Home and Away designations DO NOT Matter, since all games are played at a single venue, with the time being the only designation for each round of fixtures.

 

2) The Loop that creates the fixtures does not carry the previous values forward with the counter, so each round ends up being the same, the script needs to 'remember' the used values and then step forward to the next available value from the match list at the completion of each round.

 

As an alternative, I have a Python Script that will create the schedule perfectly, but I have no idea how to integrate Python into a Filemaker Solution, so I've moved away from that, but I do still have the Script available should I need it.  So if anyone out there is able to help out in that respect, please let me know.

 

 Any and all help is greatly appreciated  :laugh:

Many Thanks

 

Posted

Comment...

 

That file you have posted ticks all the boxes perfectly.  Many Thanks.

 

After having a quick look at the file, I was expecting something extremely complex, and difficult to follow, but that is just not the case.

 

Par Excellence on Your Behalf.

 

Again Many Thanks

 

:yep:  :)  :laugh2:  :laugh:

Posted

I've made some progress... but have found myself stuck yet again.

 

File Located Here

 

I've made a few changes to the script from Comment's solution posted earlier in the thread, too fill in some extra details, Date, Match Results, Competition Ladders.

 

So onto my Problems...

 

1. Game Time Assignments  :logik:

I've added in some steps that take from a list of times, no problems there.  But the output of the calculation does not provide for a 'Balanced' Schedule.  What is happening is that one of the teams, usually Alpha, ends up having all of the games in the earliest or latest allowable time, which obviously is not fair.  This is happening regardless of the number of teams in the league.

 

As stated earlier in the thread, the Game Time is the only designation required and it must be balanced for all teams (or as close as possible), since all games are played at the same venue.

 

2. Multiple Round Robins  :logik:

The file creates a single Round Robin Tournament perfectly, everyone gets everyone else once.  For large competitions n(teams)<12 thats easy enough. Since one cycle usually does the job.  The smaller competitions though, require multiple round robins so that they play for the entirety of the season.  The number of Round Robin Cycles required is under League::Cycles.

 

Once the first round robin cycle ends, I need it too start looping again, but this time the Round Number needs to be carried forward so that its not starting at 1 again, and the dates need to move to the next value from the list, instead of going back to the start.

Posted

This type of problems is usually "left as an exercise for the reader". A few notes, though:

 

Re multiple cycles:

I don't know what the general practice is. Logically, it would seem to me that an even cycle can be identical to the preceding (odd) cycle, except for switching the venue. IOW,  the home team is now the away team and vice versa.

 

In practical implementation, you would call the round-generating script with a cycle parameter; thus the script would know whether to switch the teams around, and how much to add to the round number.

 

 

Re times:

I don't quite understand the issue here. Aren't time slots equivalent to rounds?

  • Like 1
Posted

Re Multiple Cycles:

I wasn't really sure where to add the Loop, but your comment gives me a few ideas

 

Re Times:

I may have missed a few points earlier on so I'll elaborate a bit more... Sorry  :hmm:

 

We run all our competitions from a centralised ground, that is all games take place on one artificial Hockey Turf.  As a result, there is no Home or Away designation, since there's no Home Ground Advantage.

 

This is an example of the fixtures on any given round.

 

Round # - Date: DD/MM/YY

Game 1 - 15:00 - Alpha v Beta

Game 2 - 16:30 - Echo v Delta

Game 3 - Bye - Charlie

 

So the calculation for the HomeTeamID and AwayTeamID need too allow all of the teams get an even distribution of games across the available Time Slots.

 

This Link should help

 

I hope I have helped clear things up somewhat  :)

 

Again... Thank You for all of your invaluable assistance

Posted

IIUC, the time slot is (currently) determined by the game number (within the round). And the algorithm always assigns the first team to the first game in each round. I believe there are three possible solutions to this (in order of decreasing complexity):

 

1. Look for a "court-balanced round robin" algorithm and implement it instead of the current "pure round robin" one. I haven't been able to find it - but then I didn't look very hard.

 

2. Use pre-generated schedules. There aren't that many of them - just 16 records in a table would accommodate any number of teams between 1 to 32.

 

3. Randomize the game number within a round (or the assignment of a time slot to a game number).

This topic is 3912 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.