public function run_discussion_order($tag, $sequential = false)
 {
     global $Conf;
     $this->mcmf_round_descriptor = "";
     $this->mcmf_optimizing_for = "Optimizing assignment";
     // load conflicts
     $cflt = array();
     foreach ($this->papersel as $pid) {
         $cflt[$pid] = array();
     }
     $result = Dbl::qe("select paperId, contactId from PaperConflict where paperId ?a and contactId ?a and conflictType>0", $this->papersel, array_keys($this->pcm));
     while ($row = edb_row($result)) {
         $cflt[(int) $row[0]][] = (int) $row[1];
     }
     Dbl::free($result);
     // run max-flow
     $result = $this->papersel;
     for ($roundno = 0; !$roundno || count($result) > 1; ++$roundno) {
         $this->mcmf_round_descriptor = $roundno ? ", round " . ($roundno + 1) : "";
         $result = $this->run_discussion_order_once($cflt, $result);
         if (!$roundno) {
             $groupmap = array();
             foreach ($result as $i => $pids) {
                 foreach ($pids as $pid) {
                     $groupmap[$pid] = $i;
                 }
             }
         }
     }
     // make assignments
     $this->set_progress("Completing assignment");
     $this->ass = array("paper,action,tag", "# hotcrp_assign_display_search", "# hotcrp_assign_show pcconf", "all,cleartag,{$tag}");
     $curgroup = -1;
     $index = 0;
     $search = array("HEADING:none");
     foreach ($result[0] as $pid) {
         if ($groupmap[$pid] != $curgroup && $curgroup != -1) {
             $search[] = "THEN HEADING:none";
         }
         $curgroup = $groupmap[$pid];
         $index += TagInfo::value_increment($sequential ? "aos" : "ao");
         $this->ass[] = "{$pid},tag,{$tag}#{$index}";
         $search[] = $pid;
     }
     $this->ass[1] = "# hotcrp_assign_display_search " . join(" ", $search);
     //global $Conf; $Conf->echoScript("$('#propass').before(" . json_encode(Ht::pre_text_wrap($m->debug_info(true) . "\n")) . ")");
 }
예제 #2
0
 private function _nextRank()
 {
     $this->currank += TagInfo::value_increment($this->ordertype);
     return $this->currank;
 }