diegoquintanav / acme-data-generation

0 stars 1 forks source link

WorkPackages table is not being generated #5

Closed petarjov closed 4 years ago

diegoquintanav commented 4 years ago

I totally missed this one, fixing it asap

diegoquintanav commented 4 years ago

remind me how is a work package related to other entities? from the code in java I see

 for (int i = 0; i < SIZE; i++) {
                if (slotKinds[i].equalsIgnoreCase("Maintenance") || delays[i] > 0) {
                    workPackages += "(" + workPackageIDs[i] + ","
                            + "'" + executionDates[i] + "'" + ","
                            + "'" + executionPlaces[i] + "'" + "),\n";

                    for (int j = 0; j < MAX_WORK_ORDERS; j++) {
                        if (workOrder_workOrderKinds[i][j].equalsIgnoreCase("Forecast"))
                            forecastedOrders +=
                                    "(" + workOrderIDs[i][j] + ","
                                    + "'" + workOrder_aircraftRegs[i][j] + "'" + ","
                                    + "'" + workOrder_executionDates[i][j] + "'" + ","
                                    + "'" + workOrder_executionPlaces[i][j] + "'" + ","
                                    + workOrder_workPackageIDs[i][j] + "," // dependence between package and order
                                    + "'" + workOrder_workOrderKinds[i][j] + "'" + ","
                                    + "'" + workOrder_deadlines[i][j] + "'" + ","
                                    + "'" + workOrder_plannedDates[i][j] + "'" + ","
                                    + workOrder_frequencies[i][j] + ","
                                    + "'" + workOrder_frequencyUnits[i][j] + "'" + ","
                                    + workOrder_forecastedManHours[i][j] + "),\n";
                        else if (workOrder_workOrderKinds[i][j].equalsIgnoreCase("TechnicalLogBook"))
                            technicalLogBookOrders += "(" + workOrderIDs[i][j] + ","
                                    + "'" + workOrder_aircraftRegs[i][j] + "'" + ","
                                    + "'" + workOrder_executionDates[i][j] + "'" + ","
                                    + "'" + workOrder_executionPlaces[i][j] + "'" + ","
                                    + workOrder_workPackageIDs[i][j] + "," // dependence between package and order
                                    + "'" + workOrder_workOrderKinds[i][j] + "'" + ","
                                    + "'" + workOrder_reporteurClasses[i][j] + "'" + ","
                                    + workOrder_reporteurIDs[i][j] + ","
                                    + "'" + workOrder_dueDates[i][j] + "'" + ","
                                    + workOrder_deferreds[i][j] + ","
                                    + "'" + workOrder_MELs[i][j] + "'" + ","
                                    + "'" + workOrder_reportingDate[i][j] + "'" + "),\n";
                    }

                }
            }

What I understand from this is that

Is that correct? am I missing something?

petarjov commented 4 years ago

Correct! WorkOrdrers table has workPackage column which is supposed to be a foreign key to WorkPackage table so both ForcastedOrder and TLBOrder have a reference to it.

diegoquintanav commented 4 years ago

@petarjov I updated the code and the existing tests, and tried

$ airbase-gen sql --prob-noisy 0.3 --prob-bad 0.5 --db-pwd "admin" --hard

against a clean database. Can you check it?

diegoquintanav commented 4 years ago

I shouldn't have closed the issue, opening it again until then