コード例 #1
0
 function convertStringPrologPlansToGraphs($prologPlans)
 {
     //Clean plan for regular expressions processing
     $plans = prologPlanCollection::preparePlans($prologPlans);
     //Generate an array of all plans and their timepoints
     $plansAndTemporalOrderings = prologPlanCollection::organisePlans($plans);
     //Convert plans and ordering into a directed graphs
     $plansAndTemporalOrderingsSize = sizeof($plansAndTemporalOrderings);
     for ($index = 0; $index < $plansAndTemporalOrderingsSize; $index++) {
         $orderingCollection = $plansAndTemporalOrderings[$index]['ordering'];
         $planCollection = $plansAndTemporalOrderings[$index]['plan'];
         $planGraphList[$index] = graphPlan::convertToGraphPlan($orderingCollection, $planCollection);
         flush();
     }
     return $planGraphList;
 }
コード例 #2
0
ファイル: GraphPlan.php プロジェクト: printedheart/iwfms
 /**
  * @return void
  * @param unknown $nodes
  * @param prologPlanCollection $planCollection
  * @desc 
  */
 function populateNodes($nodes, $planCollection)
 {
     for ($index = 0; $index < sizeof($nodes); $index++) {
         $this->planGraph->addNode(new node($nodes[$index], $planCollection->getMatchingAction($nodes[$index])));
     }
 }