CPN Tools, ML Language: Compile Error when generating code - petri-net

I am trying to implement Token Bucket algorithm with the use of CPN Tools. I must say that I am very pleased with the tools and the results it provides.
Now, concerning my problem.
Firstly, I tried to build a token bucket model with just the use of black tokens and integers. So far it worked flawlessly.
Secondly, I tried to change black tokens with actual data to send (I used the Simple protocol example sending the message: "Modelling and Analysis by Means of Coloured Petri Nets.)
The problem I am having is when I try to send multiple data packets (see the model image I attached). The arc from place "Bucket" to Transmit k" and the arc from "Bucket" to "Transmit n" are where to problem is arising and I do not know how to fix it. On the arc I have inscriptions which send multiple packets (kx to send k packets and n x to send n packets)
Sometimes I would get error "Cannot bind from large color set" or the" InternalError Compile Error when generating code ... "
IMAGE: http://i.imgur.com/O5gGIW1.png
Both errors arise in the transitions "Transmit n" and "Transmit k".
Just for a reference, I also attached image where I change the arc inscription from place Bucket to Transmit transitions, so I am sending only one packet. Then it works but it is not TokenBucket then anymore.
IMAGE: http://i.imgur.com/0IDfROf.png
If you could help, I would very much appreciate it.
I can also upload my CPN model if you wanna see it for youself.

Related

How to add new parameters to be measured in the result file .sca of the OMNET++ simulator?

I'm doing a research for the VANET network for my master thesis. I'm using OMNET++, SUMO and VEINS, for the evaluation of the performance in a scenario of car accident. For the moment I want to generate some results for the received power, signal to noise ratio, bit-rate and packet collision, based on three types of antenna's. From the results that I'm taking from the .sca file doesn't show those parameters. I have done some modifications in the source codes, but with no results!
So I wanted to ask you, is there any possibility to generate the results of those parameters and if yes can you help or guide me telling in quick steps how to do it well (modifying the source code or something else)?
Hi you can take a look at omnetpp tutorial 5
https://docs.omnetpp.org/tutorials/tictoc/part5/#52-adding-statistics-collection. This should provide you the basics for scalar and vector file analysis.
To all of you that want to know, here is the overall solution:
The MAC layer extracts some control info received from the physical layer [1];
This control info (received power, snr, etc) is given in [2];
We must modify the Mac1609_4.cc to such data as vectors (results in the .vec file) [3];
[1]
https://github.com/sommer/veins/blob/master/src/veins/modules/mac/ieee80211p/Mac1609_4.cc#L558
[2]
https://github.com/sommer/veins/blob/master/src/veins/modules/phy/DeciderResult80211.h
[3] https://doc.omnetpp.org/omnetpp/manual/#sec:sim-lib:coutvector
Next in the Mac1609_4.h add the vector: cOutVector recvPower_dBm;
Now in Mac1609_4.cc add the following:
double power;
power = ((DeciderResult80211*)msg->getControlInfo())->getRecvPower_dBm();
recvPower_dBm.record(power);
This should help to record the parameters that you want!

How do I use the balance classes option for autoML in the flow interface?

I'm trying to use autoML in the flow interface for a classification problem.
My response column is a enum data type with values of 1 and 0.
My data set is really imbalanced, around 0.5% of rows have a 1 response.
I want to try the balance classes option, but every time I try it, the program ends up throwing errors.
If I check the balance classes option, am I required to also input values in the class_sampling_factors input box? If so, what do I put in?
The documentation says:
"class_sampling_factors: (DRF, GBM, DL, Naive-Bayes, AutoML) Specify the per-class (in lexicographical order) over/under-sampling ratios. By default, these ratios are automatically computed during training to obtain the class balance. This option is only applicable for classification problems and when balance_classes is enabled."
But it seems like the function fails to run unless I put something in.
I've tried putting in 200.0, 1 and also 1.0,200.0 but neither seemed to work well.
You are not required to specify the "Class sampling factors" parameter when using "Balance classes".
I just verified on H2O 3.26.0.9 that you can successfully run AutoML with "Balance classes" checked and leaving the "Class sampling factors" blank by using the HIGGS dataset (10k subset). I also entered 1.0,0.5 for "Class sampling factors" and that worked as well. I don't see any bugs reported on older versions of H2O (not sure which version you are using), so maybe the error is caused by something else?
Here's the Flow output generated by both options:

CAD secondary development

I got some taught about the CAD secondary development.I use a dll 'Teigha' to analysis the dwg file. But there no have any API can get the CAD drawing's xrefs ,so How to got the drawing's xrefs.
I tried to get the xrefs's path and analysis it as a normal drawing(I save the xrefs data to the main drawing (I think when I finished it and it can become one drawing )) but I got nothing.Why?
Then I found even though I got the all data(main drawing and xrefs) I still cannot get the correct data because the xrefs in the main drawing cant copy paste .I cannot get these change,Only I can got the origin xrefs.
So what can I do ?
In Teigha, you must use the OdDbXrefGraph.getFrom method to obtain the graph of the Xrefs. After that, you can explore the graph in a way similar to this.

Decoding a picture from a gps tracker

I'am developing a server for a GPS Tracker that can send pictures taken by a camera connected to it, inside a vehicle.
The problem is that I follow every step in the manual and I can't still decode the bytes sent by the tracker into a picture:
I receive the picture in packages separated by the headers and "tails", each one. When I receive the bytes I convert them into hexadecimals as the manual expecifies, then I have to remove the headers and "tails" and apparently after joinned the remain data and saved as a .jpeg, the image should appear, but it doesn't.
the company name is "Toplovo" from China. Have anyone else solve something similar?
Are the line feeds part of your actual data? Because if so I doubt that's supposed to happen.
Otherwise, make sure you're writing the file in binary mode. In some languages this matters. You didn't really specify, but make sure you're not in text mode. Also make sure you're not using any datatypes unsuited for hexidecimal values (again, we don't even know what language you're using, so, it's kind of hard to give specific suggestions.)

How to show the parallelism of requests in a nice graphical view?

I have currently the following setup:
An object graph of all requests read from an application server log file.
Each line is represented as a RequestPart, with the following information: start time, stop time, tier, application part that is done.
I would like to draw / to graph something that shows the following:
Show different colors for the tier the request part is in.
Show for requests that are done in parallel, that they overlap.
The relation of start and stop should be shown (not exactly, but approximately)
My first idea was to fill the rows of an excel sheet with the requests, and color each cell according to the time, the tier, ... But then I found out that excel does only allow 2^8 cells (with Excel < 2010), so that is not an option.
I'm a Ruby boy, so I checked RMagick and Gruff, but I don't like that at the end, I only have an image, so no further analysis is possible. Does anyone has an idea what to do (well, last resort: install Excel 2010, but my company will not like that).
Check out open source Timeline
Added
Tips for using it:
send your data using JSON, faster parsing on the client compared with XML.
suggest that your clients use FF, Safari or (fastest), Google Chrome
Even faster parsing of dates: send Javascript datetime literals for parsing on client. Of course, at that point you're not sending kosher JSON, but it is the fastest way to send the data.

Resources