diff --git a/htdocs/lib/Recommand/RecommandPoint.php b/htdocs/lib/Recommand/RecommandPoint.php index e0f1f22..c4b03cb 100644 --- a/htdocs/lib/Recommand/RecommandPoint.php +++ b/htdocs/lib/Recommand/RecommandPoint.php @@ -1,4 +1,7 @@ recommand->queryEdgeByID('0'); - $this->theme = new Study\Theme($theme_number); for($i=0;$irecommand->queryBelongByID($next_point,$theme->getId()); + $belong = $this->recommand->queryBelongByID($next_point,$theme_number); $weight = $belong["weight"]; $VirtualSum += $weight / $next_target->getLearnTime(); @@ -94,14 +100,19 @@ class RecommandPoint /** * 過濾非法的標的 * + * @param array $point_list 全部的標的清單 + * @param StudyActivity $activityObj 學習活動物件 + * @return array 合法的學習點 */ private function excludeIrregularTarget($point_list,$activityObj) { $regularTarget = array(); for($i=0;$iisEnableTargetId($a)ctivityObj,$nextPoint)) array_push($reregularTarget,$point_list[i]); + $nextPoint = $point_list[$i]['next_point']; + if($this->isEnableTargetId($activityObj,$nextPoint)) { + array_push($regularTarget,$point_list[$i]); + } } return $regularTarget; } @@ -116,7 +127,7 @@ class RecommandPoint public function recommand($current_point,$activity_number) { $this->activity = new Study\StudyActivity($activity_number); - $themeID = $activity->getThemeId(); + $themeID = $this->activity->getThemeId(); $this->theme = new Study\Theme($themeID); $this->gamma = $this->computeNormalizationParameter($themeID); $pointList = $this->recommand->queryEdgeByID($current_point); @@ -130,7 +141,7 @@ class RecommandPoint for($i=0;$itheme->getWeightByNextTarget($next_point); if($nextPoint->isFullPeople()) @@ -143,10 +154,10 @@ class RecommandPoint { if($nextPoint->isNumberOfPeopleZero()) $Rj = 0; else $Rj = $nextPoint->getMj()/$nextPoint->getPLj(); - $pastCost = RecommandPoint::ALPHA * $this->gamma * ($weight * ($nextPoint->getS()-$Rj+1)/$moveTime + $nextPoint->getLearnTime()); - $virtualCost = RecommandPoint::ALPHA * $this->gamma * ($wright/$nextPoint->getLearnTime()); + $pathCost = RecommandPoint::ALPHA * $this->gamma * ($weight * ($nextPoint->getS()-$Rj+1)/$moveTime + $nextPoint->getLearnTime()); + $virtualCost = RecommandPoint::ALPHA * $this->gamma * ($weight/$nextPoint->getLearnTime()); } - array_push($recommand,array("nextPoint"=>$nextPoint, + array_push($recommand,array("nextPoint"=>$next_point, "isEntity" => $isEntity, "PathCost"=>$pathCost, "VirtualCost"=>$virtualCost)); diff --git a/htdocs/lib/Recommand/here b/htdocs/lib/Recommand/here deleted file mode 100644 index e69de29..0000000