Thread: StatsLab13
View Single Post
Old 03-31-2014, 05:08 PM   #194
Huckleberry
All Star Reserve
 
Huckleberry's Avatar
 
Join Date: Apr 2003
Posts: 578
In draft_auto_list_generate.php is there an error here?

Code:
  while ($row=mysql_fetch_array($result))
  {
	  $pid=$row['player_id'];

	  $mod=0;
       	  $bcnt=0;
	  if ($row['fielding_rating_pos2']>1)
	  {
		  $mod+=.02;$bcnt+=1;
		  if ($row['fielding_ratings_catcher_arm']>100) {$mod+=.005;$bcnt+=1;}
	  }
	  if ($row['fielding_rating_pos4']>100) {$mod+=.01;$bcnt+=1;}
       	  if ($row['fielding_rating_pos5']>120) {$mod+=.008;$bcnt+=1;}
	  elseif (($row['fielding_rating_pos5']>60)&&($row['fielding_ratings_infield_arm']>100)) {$mod+=.005;$bcnt+=1;}
       	  if ($row['fielding_rating_pos6']>100) {$mod+=.017;$bcnt+=1;}
	  if ($row['fielding_rating_pos8']>100) {$mod+=.0075;$bcnt+=1;}
       	  if (($row['fielding_rating_pos9']>60)&&($row['fielding_ratings_outfield_arm']>100)) {$mod+=.005;$bcnt+=1;}
	  switch ($bcnt)
	  {
    	  case 0: 
	  case 1: $mod=$mod*1.00; break;
    	  case 2: $mod=$mod*.800; break;
	  case 3: $mod=$mod*.650; break;
    	  case 4: $mod=$mod*.600; break;
	  case 5: $mod=$mod*.575; break;
    	  case 6: 
	  case 7: 
    	  case 8: $mod=$mod*.550; break;
	  default: break;
      	  }
	  $bvalues[$pid]=$bvalues[$pid]*(1+$mod);
  }
The cases where $bcnt=6 or 7 should have values of some sort, no? Based on the code that precedes the switch command, I can come up with combinations of fielding ratings that result in both those values but can't come up with a combination that results in 8. Perhaps I don't understand what is happening here, but just wanted to check.

If I'm correct then obviously the auto list will overvalue players that have $bcnt equal to 6 or 7. Then again I haven't noticed those players being drafted way too high so I lean toward the answer that I'm not interpreting this correctly.

Last edited by Huckleberry; 03-31-2014 at 05:11 PM.
Huckleberry is offline   Reply With Quote