Multiple/no visits as long as the deliveries are picked up - or-tools

I'm trying to solve a problem using Or-Tools. I've seen a couple of issues on Github that talks about it but yet to find a crisp answer. I was wondering the new versions may have new features that can solve the problem easier. Java or Python code is preferred.
Here is the problem:
I have a non-complete graph (e.g. not all the nodes are connected). I want to start from node S and finish on node T. There are some items in some of the nodes that I want to pickup and basically deliver them in the end node. I want the fastest rout to get all the pickups. I DON'T care if I visit nodes multiple times or don't visit them at all as long as:
1- it's the fastest route
2- it covers all the deliveries
3- starts from S and ends in T

Related

Sync two offline masters when network available

I have a use case where I need to set up two physical stations at a venue. Each station will be running a couple of app servers and a mongodb server.
I can't rely on the venue's internet access so I need my app to be able to work offline and "sync" the dbs every once in a while.
I initially thought about having two masters that would somehow sync with a remote one but TIL that master-master replication is not possible with mongodb.
I've read about the active-active approach, however, that won't let me write to a different shard when offline.
I'm running out of ideas, any recommendation would be greatly appreciated.
------ Update on what I'm trying to achieve:
I'm working with a venue that has two entrances. The idea is to be able to capture some information from people attending the events (name, email, etc). After getting registered we will print a name tag with some of the info.
Everything sounds pretty easy, however, if possible, I would like to not rely on the venue's network (internet). So that's where I started struggling figuring out whats the best approach. I guess what I want is being able to have a remote mongo but if the network goes down somehow keep saving records locally and send them to the remote mongo instance when network is available again.
Extra considerations:
- Events last a couple of days, some people lose their name tag overnight, they should be able to go to either of the entrances and get it reprinted. So we should be able to find their info even if they registered in entrance A but they are asking for a reprint in entrance B.
More questions:
- Am I overthinking it? Maybe venue's network + a 4G/LTE modem as a backup should be enough? I would prefer not relying on it tho.
I believe you're overthinking things. Here's what I would do if faced with a similar situation:
From the description, it doesn't sound like the two sites need to be connected in real time at all. I would create a server on Entry A, another in Entry B, and consolidate their data each day after the day ended if required. This is because:
It's unlikely that one person will register in both sites within a single day. If they lost their tag on that day, I'll just tell them to go back to where they registered earlier and get it reprinted there. Worst case, you'll create a duplicate entry (should be obvious which is the duplicate since no one would lose their tag within seconds) but I would not anticipate hundreds of people all lost their tags within a day.
If the attendee lost their tag overnight, both servers will have synced data and should be able to reprint.
If you're concerned about the venue's Wifi access, just run cables from the server to the printing stations.
Personally, I would argue that the overnight sync is not really needed at all (see the likelihood of people registering twice). I would just collect the data from both servers after the event ended. That is, unless you have specific needs for the combined data from both entries during the 2nd day.
Note: please make sure you're running a minimum of 3-node replica set. Running a standalone instance for prod environment is not recommended. Hardware/disk corruption is a common event.

Route Costing in Anylogic

I am trying to simulate a manufacturing system that uses Automated Guided Vehicles (AGVs) to carrying loads around the network to be processed. While the AGVs are travelling, it is ideal for them to pick the fastest route to the destination (not necessarily the shortest).
Here is my model
I am kind of stuck at trying to implement a route costing algorithm, because I am not too familiar with the intricacies of this program yet. Can anyone kindly give me some rough idea on how it can be implemented in pseudo code with the following scenario:
The load needs to move from A to B and there are three possible paths. However, there is congestion in the red highlighted areas that will cause the load to take a longer time to reach point B.
How can I read the network to check for congestion and also calculate the various times needed to go to point B?

How can I get listChannels method return channels in an order I want?

We are implementing a chat application using Pubnub and in a short span of time, the number of channels for each user has reached into hundreds. In order to improve performance, I need the listChannels method to return channels in the most recently used first order rather alphabetical order which is of not much use to me.
I am hitting one roadblock after another and I very seriously considering ditching Pubnub altogether as it is creating more problems than solving them for me. Please help me with this.
Channel Groups were not implemented with what you had in mind. But you can keep a local list most active channels. Everytime the user publishes to a channel or receives a message or whatever your requirements are, just update this list.

Stuck with understanding how to build a scalable system

I need some guidance on how to properly build out a system that will be able to scale. I will give you some information about what I am trying to do and then ask my specific question.
I have a site where I want visitors to send some data to be processed. They input the data into a textarea or upload it in a file. Simple. The data is somewhat preprocessed on the client side before a POST request is made to a REST endpoint.
What I am stuck on is what is a good way to take this posted data store it and then associate an id with it that references the user since I cannot process the data fast enough for it to be returned to the user in a reasonable amount of time?
This question is a bit vague and open to opinion, I admit it. I just need a push in the right direction to keep moving. What I have been considering is throwing the data into a message queue and then having some workers process the data elsewhere and when the data is processed alert the user as to where to find it with some sort of link to an S3 bucket or just a URL to a file. The other idea was to just run the request for each item to be processed against another end-point that already processes individual records in some sort of loop client side. The problem is as follows with this idea:
To process the data it may take somewhere from 30 minutes to 2 hours depending upon the amount that they want processed. It's not ideal for them to just sit there and wait for that to finish depending on the amount of records they need processed, so I have ruled this out mostly.
Any guidance would be very much appreciated as I don't have any coworkers to bounce things off of, nor do I know many people with the domain knowledge that I could freely ask. If this isn't the right place to ask this, could you point me in the right direction as to where it should be asked?
Chris
If I've got you right, your pipeline is:
Accept item from user
Possibly preprocess/validate it (?)
Put into some queue
Process data
Return result.
You man use one or several queues on stage (3). Entity from user gets added to one of the queues. If it's big enough, it could be stored in S3 or storage alike, and only info about it put into the queue: link, add date, user id (or email of alike). Processors can pull items from queue and give feedback to users.
If you have no strict requirements on order, things get much simpler: you don't need any sync between them. Treat all the components: upload acceptors, queues, storages and processors as independent pools of processes. Monitor each pool separately. If there's some bottlenecks - add machines to that pool.

Rottentomatoes' API limits

i've been looking on the RT site but cannot find any details, i'm just patching it together from what i've read on forums:
It appears the rottentomatoes' API is limited to 10k calls per day (1 call each 8.64secs), per IP address. Eg with the one API key on two separate computers (different IPs), they will not affect each other's limits.
Is this true? Anyone know? It is for an iphone app to get the background.
Thanks
Have taken this question to the RT forum, close-voters can get busy closing this thread if you wish:
http://developer.rottentomatoes.com/forum/read/123466