#99292 - 2003-03-12 01:46 PM
Re: KiXtart Golf: CD Sorter
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
At last! A full run.
Optimised 11 CDs - the one that is not optimised can be optimised by a further "0%" apparently.
How do I do that then?
Here's the results. The golf score is not interesting as the UDF is still full of long variable names and debug code.
quote: CD #1 Title = 70's Super Funk Song #s = 20,19,16,15,13,7,6,5 CD Length = 45.00 CD Gap = 0.00 CD Gap [%] = 0.00 Opt. Length = 45.00 CD has been fully optimized A valid CD has been created
CD #2 Title = Partridge Family Unlimited Song #s = 19,9,8,4,3,1 CD Length = 45.00 CD Gap = 0.00 CD Gap [%] = 0.00 Opt. Length = 44.94 CD has been fully optimized A valid CD has been created
CD #3 Title = Three Tenors in Antarctica, Again! Song #s = 15,14,13,12,11,10,8,6,5,4,2,1 CD Length = 45.00 CD Gap = 0.00 CD Gap [%] = 0.01 Opt. Length = 44.96 CD has been fully optimized A valid CD has been created
CD #4 Title = Support Your Local KiXGolfer Song #s = 40,39,38,37,36,35,34,25 CD Length = 44.80 CD Gap = 0.20 CD Gap [%] = 0.44 Opt. Length = 44.70 CD has been fully optimized A valid CD has been created
CD #5 Title = ABBA Bubba! Song #s = 30,29,28,27,26,25,24,23,22,21,20,19,16,12,11,9,8,6,4 CD Length = 45.00 CD Gap = 0.00 CD Gap [%] = 0.00 Opt. Length = 44.96 CD has been fully optimized A valid CD has been created
CD #6 Title = Songs You Never Wanted Your Teenage Daughter To Know About Song #s = 8,7,5,4,2,1 CD Length = 44.60 CD Gap = 0.40 CD Gap [%] = 0.89 Opt. Length = 44.50 CD has been fully optimized A valid CD has been created
CD #7 Title = Moon Rocks! Song #s = 40,39,38,37,36,35,34,33,32,31,30,29,28,27,26,25,24,23,22,21,20,18, 13,11,9,6,3,2 CD Length = 45.00 CD Gap = 0.00 CD Gap [%] = 0.00 Opt. Length = 45.00 CD has been fully optimized A valid CD has been created
CD #8 Title = Ruud's Favs Song #s = 20,19,18,17,16,15,10,9,8,7,6,5,4,3,2 CD Length = 44.58 CD Gap = 0.42 CD Gap [%] = 0.92 Opt. Length = 44.58 CD can be further optimized by 0% A valid CD has been created
CD #9 Title = MTV Presents: KiXtart Rulez! Song #s = 50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29, 28,27,25,22,21,20,19,16,13,5 CD Length = 45.00 CD Gap = 0.00 CD Gap [%] = 0.00 Opt. Length = 45.00 CD has been fully optimized A valid CD has been created
CD #10 Title = Songs From the Programmer's Abyss Song #s = 50,49,48,47,46,45,44,43,42,41,40,39,38,37,36,35,34,33,32,31,30,29, 28,27,26,24,23,22,21,20,19,16,15,14,13,8,7,6,4 CD Length = 45.00 CD Gap = 0.00 CD Gap [%] = 0.00 Opt. Length = 45.00 CD has been fully optimized A valid CD has been created
CD #11 Title = Just Noise (100% Pure White Noise) Song #s = 70,69,68,67,50 CD Length = 44.25 CD Gap = 0.75 CD Gap [%] = 1.67 Opt. Length = 44.25 CD has been fully optimized A valid CD has been created
CD #12 Title = Cazy Jens And the KIXGolfers Song #s = 100,99,98,97,96,95,94,93,85,62,41 CD Length = 45.00 CD Gap = 0.00 CD Gap [%] = 0.00 Opt. Length = 45.00 CD has been fully optimized A valid CD has been created
Average CD Length = 44.85 Average Gap = 0.15 Average Gap [%] = 0.33
KiXtart KiXtart Version = 4.20 KiXGolf Script = kixgolf_cd.kix
Computer OS = Windows XP Professional CPU = Intel(R) Pentium(R) 4 CPU 2.00GHz Speed = 2000 MHz Memory = 247 MB
KiXGolf Scoring Engine Scoring Engine = 3.0.3
KiXtart Golf Score Tournament = KiXtart Golf: CD Sorter Processing Start = 2003/03/12 11:10:55.056 Processing End = 2003/03/12 12:47:29.431 Duration = 0000/00/00 01:36:34.375 # Loops = 1 # Processed CDs = 12 # Valid CDs = 12 # Optimized CDs = 11 KiXGolf Result = Valid CD Sorter (Room For Improvement) KiXGolf Score = 549
Thank you for participating in KiXtart Golf!
So, the question is what does the "0%" mean? Can this disk be optimised further or not? The optimal length is 44.58 and the created cd is 44.58 (CD#8)
Looks to me like is should be 12 optimised CDs. [ 12. March 2003, 13:48: Message edited by: Richard H. ]
|
Top
|
|
|
|
#99294 - 2003-03-12 01:55 PM
Re: KiXtart Golf: CD Sorter
|
Lonkero
KiX Master Guru
Registered: 2001-06-05
Posts: 22346
Loc: OK
|
optimal results with cd8: Songs=3,20,2,11,7,6,19,10,1,5,8,13,14,9,17
would need to calc those values but I think it's all about floating point overflow. it can also be that jens is only calculating for say 0.001 and your code is 0.0000001 better or worse in time...
_________________________
!download KiXnet
|
Top
|
|
|
|
#99296 - 2003-03-12 02:26 PM
Re: KiXtart Golf: CD Sorter
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
CD#8 only takes 3 mins to calculate so I ran again.
CD size generated is 44.5842, so my result is .0042 better than the optimal
|
Top
|
|
|
|
#99300 - 2003-03-12 03:02 PM
Re: KiXtart Golf: CD Sorter
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
quote: richard, did you calc also what is the actual time for the optimal? it can be also something like 44.5847
No, fair point. I'll do that now.
|
Top
|
|
|
|
#99301 - 2003-03-12 03:19 PM
Re: KiXtart Golf: CD Sorter
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
This is England calling...
The result in reverse order for CD#8 is...
code:
CD #8 Title = Ruud's Favs Song #s = 20,19,18,17,16,15,10,9,8,7,6,5,4,3,2 CD Length = 44.58 CD Length = 44.5842 CD Gap = 0.42 CD Gap [%] = 0.92 Opt. Length = 44.58 Opt. Length = 44.5842 CD can be further optimized by 0% A valid CD has been created
The lengths are printed twice - the second length is unformatted.
So they appear to be the same, although the script insists that it can be further optimised.
|
Top
|
|
|
|
#99303 - 2003-03-12 04:14 PM
Re: KiXtart Golf: CD Sorter
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
Joeel: Your code won't stand up to the competition as everybody else has better optimized code, which is part of the requirements.
I've also got word back from Ruud, he confirmed that there's a bug in the FORMATNUMBER() function. He has already provided me with a private build that should eliminate the bug. However, I will have to test this first and report back to Ruud.
With regards to the 'loop 100 times' issue: The 'run time' display will show whether your code can run within the allotted time, so I'm flexible on that one. I choose '100' as an relatively arbitrary number which would translate to about 2 hours per loop. Two hours seemed very reasonable to me.
I will beef up the reporting part a little bit so that the processing time will also be reported on a per-CD basis.
I'm also going to investigate the 'Can be optimized by 0.00%' issue. However, I believe it's just a display problem, as the length calculations are accurate to four digits but I'm only displaying two digits. I will modify the code accordingly.
The determination whether there's room for improvement is water-tight, however, I will double-check this, too. [ 12. March 2003, 16:41: Message edited by: sealeopard ]
_________________________
There are two types of vessels, submarines and targets.
|
Top
|
|
|
|
#99305 - 2003-03-12 04:24 PM
Re: KiXtart Golf: CD Sorter
|
Sealeopard
KiX Master
Registered: 2001-04-25
Posts: 11164
Loc: Boston, MA, USA
|
It does not have to be 100% optimized, however the rules do state quote: More precisely, given a comma-delimited list of arbitrary indices, songList, find an array of indices, indexList, such that
- sum(songList(indexList)) <= mediaLength, and
- gap = (mediaLength - sum(songList(indexList))) / mediaLength is minimized.
Without this requirement I could just return one song per CD and achieve a low KiXGolf score.
_________________________
There are two types of vessels, submarines and targets.
|
Top
|
|
|
|
#99306 - 2003-03-12 04:35 PM
Re: KiXtart Golf: CD Sorter
|
Richard H.
Administrator
Registered: 2000-01-24
Posts: 4946
Loc: Leatherhead, Surrey, UK
|
quote: I'm also going to investigate the 'Can be optimized by 0.00%' issue. However, I believe it's just a display problem, as the length calculatiosn are accurate to foru digits but I'm only displaying two digits. I will modify the code accordingly.
The determination whether there's room for improvement is water-tight, however, I will double-check this, too.
Eh? How do you mean?
If you look ate the result I posted above (CD#8) the optimal value and the value I calculated are the same to 4 decimal places, but I still get a "could be optimised further". This gives me a "room for improvement", as it is the only CD in the 12 which reports a problem.
|
Top
|
|
|
|
Moderator: Arend_, Allen, Jochen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Mart
|
0 registered
and 370 anonymous users online.
|
|
|