diff --git a/publicodes-voiture.ui.json b/publicodes-voiture.ui.json deleted file mode 100644 index 72d08c3..0000000 --- a/publicodes-voiture.ui.json +++ /dev/null @@ -1 +0,0 @@ -{"categories":{"voiture":{"index":0,"sub":[]},"usage . quotidien":{"index":1,"sub":[]},"usage . vacances":{"index":2,"sub":[]}},"questions":{"voiture":[["voiture . motorisation","voiture . gabarit","voiture . prix d'achat","voiture . thermique . carburant","voiture . thermique . consommation"]],"usage . quotidien":[["usage . quotidien . distance","usage . quotidien . nb personne"]],"usage . vacances":[["usage . vacances . distance","usage . vacances . nb personne"]]}} \ No newline at end of file diff --git a/scripts/generate-empreinte.js b/scripts/generate-alternatives.js similarity index 90% rename from scripts/generate-empreinte.js rename to scripts/generate-alternatives.js index 1b2f9a4..9a0541c 100644 --- a/scripts/generate-empreinte.js +++ b/scripts/generate-alternatives.js @@ -1,8 +1,9 @@ /** - * Script to generate all the combinations of the carbon emissions + * Script to generate all the possible combinations of carburants, gabarits and + * motorisations */ -export default function generateCombinations(rules) { +export default function generateAlternatives(rules) { const carburants = Object.keys(rules).flatMap((key) => { if ( key.startsWith("voiture . thermique . carburant") && @@ -45,6 +46,8 @@ export default function generateCombinations(rules) { "ngc . transport . voiture . motorisation": `'${motorisation}'`, "ngc . transport . voiture . km": "usage . distance annuelle", "ngc . transport . voiture . voyageurs": 1, + "ngc . transport . voiture . thermique . consommation aux 100": + "voiture . thermique . consommation", } const contexteBaseCost = { @@ -68,7 +71,7 @@ export default function generateCombinations(rules) { valeur: "ngc . transport . voiture", contexte: { ...contexteBaseEmission, - "voiture . thermique . carburant": `'${carburant}'`, + "ngc . transport . voiture . thermique . carburant": `'${carburant}'`, }, } rules[`coût . ${motorisation} . ${gabarit} . ${carburant}`] = {