Queue length of a service block in a bar chart - anylogic

I want to create a bar chart which contains the average of the amount of agents in the embedded queue of a service-block. I want to show the mean of agents while the simulation who are waiting in the queue.
What code I have to fill in the field: "Value:" in the bar chart properties?
Tank you.

You can create a dataset (noInQueue) containing the myQueue.size() information and on the chart you need to type noInQueue.getYMean().

Related

Anylogic-Build a time color chart for the utilization of resource pools

Resorting to Anylogic I buiild a job shop scheduling problem. I have 20 jobs and 5 machines. I want to build a time color chart (Just like a gantt chart) for the utilization of each of my machines, having like red for when the machine is idle and green when is active.
This is my model. Each of the 5 resource pool (with unit capacity) is a machine from the 'maqq'agent population. 'jobs' agent circulate between the machines.
Basically i just want to know what can I do to know if the machines are active or not so that resorting to the time color chart I can build something like this chart.
Gannt Charts are not that easy in AnyLogic, and we have resorted to building our own custom Gantt Charts in our Material Design Library. That said it is possible to create something similar using the Time Color Chart object
You simply use Data Sets in the chart and set up the values for the color mapping. In my example, it was a simple 1, and 0 binary option.
You can record the state of your machine using the action code inside the blocks. For the service blocks, you can set it up here
Or in the resource pool here

How to create a chart in Kibana from a set number

I have a task that sends to Kibana a number of files it's supposed to run, then it sends an event for each file that finishes. How can I configure my Kibana to give me a pie chart of remaining files from finished files? (If it's impossible to do with a pie chart I'd like to hear about other charts to do that with)
Ideally if for example I have 20 files and 5 finished I want my pie to be 3 quarters of one color (waiting files) and 1 quarter another color (finished files).
If you're to use the pie chart, you might have to differentiate the file whether it's a finished one or a waiting one by using filter aggregation. You can have a look at this, for more about using the filter.
So in your case, let's assume if you have a field called status which has distinct values as waiting and finished. What you can do is to have two filters containing:
filter 1
status:'waiting'
filter 2
status:'finished'
So the above would actually split your pie chart into two sections where one containing the waiting events and the other containing finished events with two different colors. This is just a thought so that you could reproduce. Hope it helps!

How can I make a dynamic line chart with JavaFX using a socket input

I have written some code that reads a socket input and outputs the data that I want in an ArrayList of Double values. I would like to keep updating this ArrayList with current values and plot them to a line chart in JavaFx.
How do I set up my javafx file such that it will update the chart as new data is available from the socket?
The data in a JavaFX chart is a ObservableList of ObservableLists - one ObservableList for each chart line series. The chart listens to changes on the observable lists of data and, when you modify any of the data in any of these ObservableList (due to the observable nature of them), the chart will automatically update itself. So you don't really need to do much.
Before changing the chart data, set the animated property of your chart to an appropriate value; i.e., turn off animation if you want the new values in the chart to display directly, or turn on animation if you want the data points in the chart to slowly move to the new values.
You state that you are receiving the data over a socket. Usually with traditional socket IO, you have a thread monitoring the socket for new data - this should not be the JavaFX application thread otherwise your application UI will hang while the awaiting new data. When the socket monitoring thread receives new data, it should not modify the the ObservableList for the chart data directly. Instead, it should wrap any modifications to the chart's observable list in a Platform.runLater() call so that the modifications to the chart data occur on the JavaFX application thread.

Chartbreak on specific row count (large datasets)

Is there a possibility to create a new chart if a specific number of rows is reached?
Lets say i have 150 entries in my dataset, but the chart is only readable with 50 entries each. How could i do that?
PS: To the Editor i'm working with dynamic-reports which use jasper-reports.
I figured out the following workaround to this problem.
The max size of the DataSources in the list specifies the max rows per chart.
This solution consists of two classes:
The Concenator (Observer)
The ReportGenerator (Runnable or Thread,
Observable)
Visio sketch of the concenator:
http://i.stack.imgur.com/aMmvC.png
The Concenator first generates a list of DataSources with each having a maximum length.
Than for each DataSource in the list a ReportGenerator will be started, he also will get the pagenumber (for final sorting after collection).
The Concenator waits until every reportpage is delivered.
Whenn every page is collected the concenator sorts the pages according to the number and then stick them together page by page.
PS: I have an visio sketch ready but less reputation for posting it directly.

BIRT, repeating chart in list

I have a problem using Eclipse BIRT, i'm trying to create a list with group headers including a chart relevant to the specific group header. So lets say i'm trying to create a list with all employees including their sick hours monthly in a bar chart.
Name
[CHART], Contract hours, Division, job
Name
[CHART], Contract hours, Division, job
How can i create this without creating a specific data set for every employee? This is what i am currently doing and it renders the grouping functionality of my list useless since i need to create a new dataset and list for each employee.
Regards,
Rik
When you add the chart, do not bind it to the Report Data Source. On the data tab select "Inherit Data From Container". This will ensure the chart is bound to the data that is populating the list, not the underlying (ungrouped) data set.
Here is a smple that does what you need including a link to a live running demo.
Dynamic Chart Creation at BIRT Exchange Dev Share
Good Luck!