Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unassigned jobs should show all data for a job. #243

Closed
rishabhdeepsingh opened this issue Jun 20, 2019 · 7 comments
Closed

Unassigned jobs should show all data for a job. #243

rishabhdeepsingh opened this issue Jun 20, 2019 · 7 comments

Comments

@rishabhdeepsingh
Copy link

Unassigned jobs are not showing all details it should display all details about the job.
example as given here.

  "unassigned": [
    {
      "id": 4,
      "location": [2.41808, 49.22619]
    }
  ]
@jcoupey
Copy link
Collaborator

jcoupey commented Jun 20, 2019

To be honest, I think the sole purpose of providing the location in output is to be able to plot unassigned jobs in the frontend (I think the unassigned array actually started as a list of ids).

On the other hand, in a production setting, jobs ids will typically be unique identifiers from some database. I'm not sure we should really care about providing back context information that is already accessible from the client side?

@rishabhdeepsingh
Copy link
Author

I thinking providing more information is good.
Let us say we are using Vroom as a wrapper and after that, we need to plot the data on a map. It will be better if we have more information rather than we need to again put a query on the database. This will reduce network issue.

@jcoupey
Copy link
Collaborator

jcoupey commented Jun 21, 2019

By "client side" I meant any piece of code that generated the vroom input, that de facto already has access to all job descriptions without any outside database query.

As I mentioned above, I've used the location of unassigned jobs in output to plot them in the frontend. But this is really laziness on my side, I should just have reused the existing job objects generated in javascript to perform the query. Then I could have sticked to a list of ids for the unassigned array without restricting possible usage.

@rishabhdeepsingh
Copy link
Author

So, I think replacing with the original Job Object and vehicle Object is the way to go. So that we don't have to filter data again.

@jcoupey
Copy link
Collaborator

jcoupey commented Jun 26, 2019

replacing with the original Job Object

Technically that's indeed what you should do if you want to add more information in output. Else you might end up outputting some default values (e.g. for time windows) that are actually stored in Job objects but where not in input.

But again I don't think adding a lot of stuff in output just for convenience is a good idea. I can't think of a use-case where this would be mandatory (see previous comments), so I would probably not merge it in master.

@rishabhdeepsingh
Copy link
Author

I think if someone wants to do computation after the output so. giving full Object will be good as he/she don't have to go through input data again which will require an additional O(n) complexity.
That's why I was saying replacing with the Original Object will be good.

@jcoupey
Copy link
Collaborator

jcoupey commented Jun 26, 2019

require an additional O(n) complexity

Yes, you want to avoid that. You need to have a constant-time access to the jobs created for the input problem, based on their id. For example in javascript, you could store a simple object using ids as keys and storing a reference to a job object as value.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants