 |
vrpRouting
0.3
|
Go to the documentation of this file.
91 job->
id =
get_Idx(tuple, tupdesc, info[0], 0);
138 const int column_count,
141 clock_t start_t = clock();
145 const int tuple_limit = 1000000;
154 bool moredata =
true;
155 (*total_jobs) = total_tuples = 0;
159 while (moredata ==
true) {
160 SPI_cursor_fetch(SPIportal,
true, tuple_limit);
161 if (total_tuples == 0) {
164 size_t ntuples = SPI_processed;
165 total_tuples += ntuples;
175 if ((*jobs) == NULL) {
176 elog(ERROR,
"Out of memory");
180 SPITupleTable *tuptable = SPI_tuptable;
181 TupleDesc tupdesc = SPI_tuptable->tupdesc;
182 for (t = 0; t < ntuples; t++) {
183 HeapTuple tuple = tuptable->vals[t];
185 &(*jobs)[total_tuples - ntuples + t], is_plain);
187 SPI_freetuptable(tuptable);
193 SPI_cursor_close(SPIportal);
195 if (total_tuples == 0) {
200 (*total_jobs) = total_tuples;
202 time_msg(
"reading jobs", start_t, clock());
218 int kColumnCount = 9;
221 for (
int i = 0; i < kColumnCount; ++i) {
229 info[1].
name =
"location_id";
230 info[2].
name =
"setup";
231 info[3].
name =
"service";
232 info[4].
name =
"delivery";
233 info[5].
name =
"pickup";
234 info[6].
name =
"skills";
235 info[7].
name =
"priority";
236 info[8].
name =
"data";
255 db_get_jobs(sql, rows, total_rows, info, kColumnCount, is_plain);
struct Vroom_job_t Vroom_job_t
size_t pickup_size
Quantities for pickup.
SPIPlanPtr pgr_SPI_prepare(char *sql)
char * spi_getText(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info)
under development
MatrixIndex get_MatrixIndex(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, MatrixIndex opt_value)
@params [in] tuple @params [in] tupdesc @params [in] info about the column been fetched @params [in] ...
Amount * delivery
Job service duration.
Priority get_Priority(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, Priority opt_value)
@params [in] tuple @params [in] tupdesc @params [in] info about the column been fetched @params [in] ...
Priority priority
Number of mandatory skills.
void pgr_fetch_column_info(Column_info_t info[], int info_size)
Function tells expected type of each column and then check the correspondence type of each column.
Portal pgr_SPI_cursor_open(SPIPlanPtr SPIplan)
TInterval get_PositiveTInterval(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, TInterval opt_value)
@params [in] tuple @params [in] tupdesc @params [in] info about the column been fetched @params [in] ...
Duration get_Duration(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, Duration opt_value)
@params [in] tuple @params [in] tupdesc @params [in] info about the column been fetched @params [in] ...
Duration service
Job setup duration.
Skill * skills
Number of pickup quantities.
MatrixIndex location_id
The job's identifier.
Amount * pickup
Number of delivery quantities.
Duration setup
Location index of job in matrix.
char * data
Priority level of job.
void time_msg(char *msg, clock_t start_t, clock_t end_t)
int64_t * spi_getPositiveBigIntArr_allowEmpty(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, size_t *the_size)
Function returns the values of specified columns in array.
uint32_t * spi_getPositiveIntArr_allowEmpty(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, size_t *the_size)
Function returns the values of specified columns in array.
Idx get_Idx(HeapTuple *tuple, TupleDesc *tupdesc, Column_info_t info, Idx opt_value)
@params [in] tuple @params [in] tupdesc @params [in] info about the column been fetched @params [in] ...
bool column_found(int colNumber)
Check whether the colNumber represent any specific column or NULL (SPI_ERROR_NOATTRIBUTE).
size_t delivery_size
Quantities for delivery.
size_t skills_size
Mandatory skills.