is there a way to make the waiting time of an agent based on a resource availability in the Pedestrian Library ? to make agent wait until he got served by a certain resource ?
You can use such an arrangement:
It might make you animation slightly more difficult, but it should work depending on the specifics of your model.
Related
Not sure whether anybody has similar query here, assume we do a performance tracing on a single page application completely loaded on a url, how to get the total waiting time on networking time for all resources?
I've never heard about an existing tool that would provide the exact metric you're looking for. But you could write a mini script that uses the Resource Timing API. It is easy to list all network requests and sum up waiting times. More info here.
Then, if you need to automate measures, you can use Puppeteer to run your script on a headless Chrome.
After reading into the Dapr docs, I'm left with a few questions regarding the behavior of input bindings. From what I understand, it's not possible to tell Dapr that a specific input binding should only trigger a specific endpoint of one particular app in a declarative sense. Rather, you create an input binding and define its endpoint (e.g. 'checkout'), and then dapr will test all apps for that endpoint. Correct?
If so then, tbh, I don't understand this design decision. For example, if the input binding is coming from a queue (e.g. SQS), then each item should only be processed once. But then, if multiple apps are automatically configured to process items from the queue simply because they have the same endpoint, how would you guarantee that the correct one does the job? Does this behavior change if the apps are in the same vs. differing namespaces?
In this use-case, this set-up is a big bummer since it means you cannot develop your apps independently (or else you risk running into naming collisions).
Hopefully I've missed a few details, so please correct me if I'm wrong. Thank you!
AnyLogic provides traditional traffic lights which are triggered on the basis of time. I am creating a new road traffic management system in which I want to trigger traffic lights on the basis of the greatest car density among the four roads. Is there any function or element that would help me to do so?
No, you need to code it yourself.
That, however, is entirely possible. Just learn more about AnyLogic and how to write code, how to count cars on a road, how to manually switch traffic lights, etc.
Then, you can easily make it happen.
I have a RESTful API with resources updates once a week. That is, for each resource, I update it once and week and allow clients to access it. It's an ever changing calculator.
There are probably 10,000 resources which could be requested.
Is it possible to put something like this behind a CDN? Traditionally CDNs are for undeniably static content, ie images. I'm not sure where my situation sits in the spectrum of dynamic <-> static.
Cheers
90% of the resources might not even get called, and if they are, will
get called a few times only. It wont be a mass of repetitive calls.
Right there in your comments, you just showed me that a CDN is not beneficial to you.
Usually how a CDN works is the first call it is downloaded from the main server to the regional CDN node then delivered to the client meaning the first GET will have no improvements. The following GETs to the same regional node will have the speed improvement. If you have little to no repetitive calls, then you will not see any noticeable improvement.
As I said in the comments, for small files, clients are probably spending as much time on the DNS lookup as they are on the download. Look into a global DNS solution (like Anycast) to reduce connection times. This is easy to setup and requires little to no maintenance.
I think it's entirely reasonable to put it behind a CDN if you think your content will reach the appropriate level of scale. As long as the cache-control headers are set such that the latest content is loaded when the cached version may be stale, you'll be fine.
The main benefit of CDNs comes when resources are requested from a variety of different sources, and so siteY.com can use the same cached version of a resource as siteX.com. Do you anticipate your resources will be requested from various different sources?
I'm planning on developing a multiplayer strategy game for the iOS platform. However, being a strategy game with multiple "units", there will likely be imbalances in gameplay, that will need to be addressed with constant mechanic-tweaking (upgrading / nerfing certain units).
The easiest way to accomplish this would simply be to change the mechanics within the app itself, and constantly submit updates to Apple. However, updates take time to propagate through Apple's review process (so the changes wouldn't be instantaneous), and I would need to do checks to see if all the players in the game are running the same version of the game, force users to update to the latest version of the game, etc.
What I'm thinking of doing instead is something similar to what the game Uniwar does. Every time the game is launched, it appears to check if there are any gameplay tweaks available, and if there are, it downloads the updates (and shows an update message to the user detailing what has changed).
However, as a relatively new programmer, I don't really know what would be the easiest way of accomplishing this. Would I host a text file online containing the unit statistics, and get the game to check that file for changes? Or is there some better, more efficient way? And if I were to do it this way, how would I do it?
First, ensure that your rules are some sort of resource you can easily change (be it binary or text-based). The most convenient way of updating these would be to periodically poll a server, most conveniently using the HTTP protocol, fetching updates as needed. The way I see it, there are two ways of doing this.
The first method uses the excellent caching abilities of the HTTP protocol, and as such requires a server (and client library) that understands these. The basic idea would be to have a copy of the latest version of the game mechanics published on a server (say, to http://example.org/mechanics.gz, and then have the client issue conditional GET requests with the If-modified-since header set to the time the last update check was performed. The HTTP protcol will den effectively do the rest for you, issuing a 304 Not modified if there is no update, and sending the new mechanics if there is one. This method has the disadvantage that the whole mechanics file has to be downloaded on every update (no diffs can be used), and that old versions won't be available, but it has an appealing simplicity.
The second method would consist of having a list of updates (well, their URI, ID and release date), say http://example.org/updates.xml, which the client pulls on every poll. The client then checks if there are any updates it doesn't have, and downloads and applies these in chronological order. Using this method, old updates can be made available (and will have permanent links), and diffs may be used. This is useful if history is important or if game mechanic files are large.
The format of the file doesn't really matter -- use whatever works for you. The key to being able to tune the gameplay, I think, is to turn the rules of the game into objects that you can configure. If the rules are all objects, you can do things like changing the order in which they're applied, the weight given to each one, the conditions under which a rule becomes effective, etc. You might have an object that's responsible for managing and properly applying the rules, basically a "rule model." Once you have that, all you need to do is to implement NSCoding in your rule and rule model classes and you can easily write and read rule configurations.