+ sprintf(print_buf, "'%d'(%f) ", var->id_int, var->weight);
+ trace_buf =
+ xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1);
+ strcat(trace_buf, print_buf);
+ }
+ sprintf(print_buf, ")");
+ trace_buf =
+ xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1);
+ strcat(trace_buf, print_buf);
+ fprintf(stderr, "%s", trace_buf);
+ //XBT_DEBUG("%20s", trace_buf); FIXME
+ trace_buf[0] = '\000';
+
+ XBT_DEBUG("Constraints");
+ /* Printing Constraints */
+ cnst_list = &(sys->active_constraint_set);
+ xbt_swag_foreach(cnst, cnst_list) {
+ sum = 0.0;
+ elem_list = &(cnst->element_set);
+ sprintf(print_buf, "\t");
+ trace_buf =
+ xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1);
+ strcat(trace_buf, print_buf);
+ sprintf(print_buf, "%s(",(cnst->shared)?"":"max");
+ trace_buf =
+ xbt_realloc(trace_buf,
+ strlen(trace_buf) + strlen(print_buf) + 1);
+ strcat(trace_buf, print_buf);
+ xbt_swag_foreach(elem, elem_list) {
+ sprintf(print_buf, "%f.'%d'(%f) %s ", elem->value,
+ elem->variable->id_int, elem->variable->value,(cnst->shared)?"+":",");
+ trace_buf =
+ xbt_realloc(trace_buf,
+ strlen(trace_buf) + strlen(print_buf) + 1);
+ strcat(trace_buf, print_buf);
+ if(cnst->shared)
+ sum += elem->value * elem->variable->value;
+ else
+ sum = MAX(sum,elem->value * elem->variable->value);
+ }
+ sprintf(print_buf, "0) <= %f ('%d')", cnst->bound, cnst->id_int);
+ trace_buf =
+ xbt_realloc(trace_buf, strlen(trace_buf) + strlen(print_buf) + 1);
+ strcat(trace_buf, print_buf);
+
+ if (!cnst->shared) {
+ sprintf(print_buf, " [MAX-Constraint]");
+ trace_buf =
+ xbt_realloc(trace_buf,
+ strlen(trace_buf) + strlen(print_buf) + 1);
+ strcat(trace_buf, print_buf);
+ }
+ // XBT_DEBUG("%s", trace_buf);
+ fprintf(stderr, "%s\n", trace_buf);
+ trace_buf[0] = '\000';
+ xbt_assert(!double_positive(sum - cnst->bound),
+ "Incorrect value (%f is not smaller than %f): %g",
+ sum, cnst->bound, sum - cnst->bound);