#99253 - 2003-03-12 12:37 AM
Re: KiXtart Golf: CD Sorter
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
I got fed up with the blank screen so I stopped it and added some diagnostic messages to the main script.
So far I've got this:
code:
Loop #1 @ 09:29:59 CD #1 @ 09:29:59 CD #2 @ 09:31:37 CD #3 @ 09:31:39 CD #4 @ 09:31:43 CD #5 @ 09:31:46
It is now 11:42 local time, so CD#5 has taken 2 over 2 hours and hasn't finished wherase the rest of them took no more than a few minutes. Hmmm. very odd. Best have another look at that code...
|
Top
|
|
|
|
#99256 - 2003-03-11 02:39 PM
Re: KiXtart Golf: CD Sorter
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
Urk!?
I think I've found part of the problem that CD#5 is taking so long. From a debug message: quote: Disk #5 Iteration #4 GAP=1.52655665885959E-015 LIST=....
Now, I've got a line which should exit the routine when the gap is less than 0.0001, but this very small value doesn't seem to trigger it.
Hmmm.
|
Top
|
|
|
|
#99259 - 2003-03-11 04:04 PM
Re: KiXtart Golf: CD Sorter
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
I have posted an updated KiXGolf package at http://people.bu.edu/jenmeyer/kixtart/kixgolf_cd.zip
The change is that it now saves the results for each CD to both the screen and the results file. An example results file is part of the package. I also added some calculations that will display the time the script needed to run. I willnot show the start date/time, the end date/time and the duration as part of the scoring part.
The goal of the KiXGolf tournament has not changed. It is still about optimizing for least keystrokes.
The only reason I put the 'loop 100 times' into the code is to deter the use of a brute-force approach. Though the 'brute-force approach' is defimitely a valid one, I don't see it as a challenge to just create a couple of FOR loops. be creative!
I already gave one hint for a potentially powerful algorithm for this type of problem. If eerybody wished, I could spell out the method(s) that could be used. However, you would still have to code it.
So far, I've already seen one solution posted which fulfills the requirements, namely it produced a list of song indices for each CD with each CD having a total length of <45 and it did finish in time. And Patrick did't even use the fastest computer for this
I would also recommend to run your tests with just one loop and/or just one CD. [ 11. March 2003, 16:12: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.
|
Top
|
|
|
|
#99260 - 2003-03-11 04:48 PM
Re: KiXtart Golf: CD Sorter
|
MightyR1
MM club member
Registered: 1999-09-09
Posts: 1264
Loc: The Netherlands
|
Jens,
Brute force will search for "Perfect"... Really nice to get the best score out of 1,267,650,600,228,229,401,496,703,205,376 possible solutions (CD12)
I know which algorithm type your talking about, but can't determine the three methods of approach you mean.
Others,
Does anyone else have a clue what Jens is talking about???
_________________________
Greetz, Patrick Rutten
- We'll either find a way or make one... - Knowledge is power; knowing how to find it is more powerful... - Problems don't exist; they are challenges...
|
Top
|
|
|
|
#99263 - 2003-03-11 04:59 PM
Re: KiXtart Golf: CD Sorter
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
quote: Others,
Does anyone else have a clue what Jens is talking about???
Nope, haven't got a clue.
Two nations separated by a common language
|
Top
|
|
|
|
#99268 - 2003-03-11 08:13 PM
Re: KiXtart Golf: CD Sorter
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 700 anonymous users online.
|
|
|