Add UI for the evolutionary algorithm#1587
Closed
tahini wants to merge 14 commits intochairemobilite:mainfrom
Closed
Add UI for the evolutionary algorithm#1587tahini wants to merge 14 commits intochairemobilite:mainfrom
tahini wants to merge 14 commits intochairemobilite:mainfrom
Conversation
Collaborator
Author
|
Ce qui fonctionne:
Ce qui ne fonctionne pas encore:
|
Collaborator
Author
|
TODO avant de sortir de draft et compléter le tout:
Mais toutes les options sont envoyées correctement sur le serveur (qui ne gère pas encore les fichiers correctement). Donc cette branche peut être utilisée pour travailler sur les tâches côté backend. |
b2f837d to
82ce0c6
Compare
When the user selects a new file, the file loading status should be updated as the current file is not uploaded yet. We need a `resetFileUpload` callback to be provided by the `FileUploaderHook`.
A common use case is to upload a csv file and map its fields to some
specific object data, for example, latitude/longitude of points, time,
name, ids, etc. This class and component simplifies this use case.
To use these new types and components, a description of the fields to
map is required: see the `CsvFieldMappingDescriptor` type for details.
There are 3 types of field mappings:
* `single`: maps a given key to a field in the csv field
* `latLon`: needs a latitude and longitude field from the csv. A key of
this type will result in 2 mappings: `${key}Lat` and `${key}Lon`. Such
a field will also require a `projection` to be specified. There is one
`projection` per set of descriptors.
* `time`: represents a time field. For each time field, 2 additional
information should be provided by the user: `${key}Type` will specify
if the time is `arrival` or `departure` and `${key}Format` specifies the
format of the time field (for example `HMM`, `HH:MM`, etc).
An object, `CsvFileMapping`, handles the validation/error messages, csv file
and mapping updates.
The React component `GenericCsvImportAndMappingForm` takes a current
mapping, along with an array of field mapping descriptors and
automatically handles the file selection and mapping widget updates.
Components requiring csv file mapping capabilities can just make use of
this component and pass a `onUpdate` callback to be notified of changes.
fixes chairemobilite#1553 Add types for the `evolutionaryTransitNetworkDesign` job. It copies the types from the current `Simulation` class, except that the routingAttributes will later be part of the simulation methods instead of defined for the whole job. This also adds the worker code to run the job in the `TransitionWorkerPool` thread. The result types are still to be determined.
fixes chairemobilite#1560 The `OdTripSimulationOptions` type is update to better split the attributes into sub attributes: * `demandAttributes`: match the type of the `batchRoute` job, and adds a field for the sampleRatio of the demand to evaluate each scenario. It also requests an optional trip weight field, from the trip's attributes. * `transitRoutingAttributes`: They used to be defined at the network design level, but they belong to the simulation method * `evaluationOptions`: Specify the cost functions to use to compare OD trip results between simulations. The `SimulationAlgorithmOptionsDescriptor` type is updated to support nested options, but also 'custom' (for now, for example for files and csv fields). The `OdTripSimulation` method is rendered temporarily ineffective, as issues chairemobilite#1542, chairemobilite#1545 and chairemobilite#1541 and maybe chairemobilite#1397 need to be addressed first.
part of chairemobilite#1426 Add the translations for the network design interface strings Add the networkDesign section to the UI, disabled by default. We can enable it by default later when documentation and everything is set to work. In the meantime, on can simply add the following to their local `config.js` file: ``` sections: { networkDesign: { enabled: true } } ``` Advertise the transit network design panel in the contributions. Add the panel component, which lists the available `evolutionaryTransitNetworkDesign` and allow to replay them. Users can also create new network design jobs from scratch, but for now the form is empty.
fixes chairemobilite#1426 TODO * [] Configure simulation method * [] Handle csv file upload/copy from job on the server-side * [] Handle form errors * [] Test
This component takes a `SimulationAlgorithmDescriptor` array and creates widget for each option type.
This function takes a FileConfig object and creates the proper configuration to let the new job get the files from where it is set. If the file was uploaded, it fetches in the user's import directory. If it was part of a previous job, it loads the job, makes sure the user is allowed and fetches the file location for the desired file key.
The `TransitOdDemandFromCsv` now inherits the `CsvFileMapping` class instead of the previous csv file. It calls the constructor with the desired mapping descriptors. The demand type is updated to be of type `CsvFileAndMapping`. The backend routes are updated accordingly with the new types. The OdTripProvider's option type is updated with the new mapped fields, but except for naming, it works as before, using the new mappings. In the frontend, the `BatchAttributesSelection` is not required anymore, and the `ConfigureDemandFromCsvForm` component can be replaced with the `GenericCsvImportAndMappingForm`.
82ce0c6 to
ff903c6
Compare
Collaborator
Author
|
part of #1600 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add the UI to configure the transit network design job: with the transit network configuration, algorithm specific parameters, as well as the simulation method parameters.
It adds a transit network design panel with a list of jobs, that can be controlled and replayed.