static void permute_one (void *arg, transition_info_t *ti, state_data_t dst, int *cpy) { (void) cpy; permute_t *perm = (permute_t*) arg; int seen; seen = state_info_new_state (perm->next, dst, ti, perm->state); if (EXPECT_FALSE(seen < 0)) { global->exit_status = LTSMIN_EXIT_FAILURE; if (run_stop(perm->run_ctx)) { Warning (info, "Error: %s full! Change -s/--ratio.", state_store_full_msg(seen)); } return; } switch (perm->permutation) { case Perm_Shift: if (ti->group < perm->start_group) { perm_todo (perm, ti, seen); break; } else // fall through case Perm_None: perm->real_cb (perm->call_ctx, perm->next, ti, seen); ti->por_proviso &= perm->por_proviso; break; case Perm_Shift_All: if (0 == perm->start_group_index && ti->group >= perm->start_group) perm->start_group_index = perm->nstored; // fall through case Perm_Dynamic: case Perm_Random: case Perm_SR: case Perm_RR: case Perm_Otf: case Perm_Sort: perm_todo (perm, ti, seen); break; default: Abort ("Unknown permutation!"); } }
int main(int argc,char *argv[]){ if(argc != 3){ std::cout << "Usage: " << argv[0] << " [input file] [output file]" << std::endl; exit(1); } std::cout << "This is the LiSA open shop branch and bound module." << std::endl; std::cout << "PID= " << getpid() << std::endl; G_ExceptionList.set_output_to_cout(); struct BranchList *DeleteBranch; Initialize(); Read_Data(argv[1]); run_start(); if ( Compute_Head_Tail() ){ Heuristic_Schedule(); if ((SonNode->lower_bound = Additional_Arcs()) < UpperBound){ Compute_Blocks(); Compute_BranchList(); ActualNode = SonNode; Push(); if ( (SonNode = new struct NodeType) == NIL ) { G_ExceptionList.lthrow("main,SonNode: kein Speicherplatz", Lisa_ExceptionList::NO_MORE_MEMORY); exit(1); } SonNode->blocks = NIL; SonNode->order = NIL; } } while (FirstOfStack != NIL && !abort_algorithm){ Pop(); Update_Arcs(); while (ActualNode->order != NIL && ActualNode->lower_bound < UpperBound){ Fix_Arcs(ActualNode->order->branch_op, ActualNode->order->before_or_after, ActualNode->order->kind_of_block); DeleteBranch = ActualNode->order; ActualNode->order = ActualNode->order->next; delete DeleteBranch; if ( Compute_Head_Tail() && Compute_LowerBound() < UpperBound && (SonNode->lower_bound = Additional_Arcs()) < UpperBound){ Heuristic_Schedule(); if ( SonNode->lower_bound < UpperBound ){ Compute_Blocks(); Compute_BranchList(); SearchTreeNodes++; Push(); ActualNode = SonNode; if ( (SonNode = new struct NodeType)== NIL ){ G_ExceptionList.lthrow("main,SonNode: kein Speicherplatz", Lisa_ExceptionList::NO_MORE_MEMORY); exit(1); } SonNode->blocks = NIL; SonNode->order = NIL; }else{ Update_Arcs(); } }else{ Update_Arcs(); } } } run_stop(); Write_Solution(argv[2]); return(0); }