Java Library for Steady State Solution for DTMCs - java

I have been using jMarkov for analyzing CTMCs. This appears to be the most well defined Java library for this purpose. One of the part in my analysis also requires Steady State Solution of a DTMC. Though jMarkov manual mentions that it can handle DTMCs as well but the authors seem to have ignored the case. The documentation of the library, hence, seems to be incomplete.
Can someone guide me through jMarkov OR point me to a part in the manual that can be useful? If there exists another library I could use, that would be great as well. Additionally, I would be okay if someone could point me to a Java implementation that just helps me find Eigenvector of a Matrix.
Thanks!

Maybe not for you but for someone else who wants to try jMarkov, there are thw possible solutions for this issue:
First, i think jMarkov claims to handle DTMC as any DTMC can be transformed into a CTMC in a normalization process. So you have to transform your DTMC into a CTMC in order to take advantage of jMarkov.
Second, I'm sure jMarkov also allows to handle DTMC without normalization. If you specify your problem a little bit we could build an example from your problem.
Regards,

Related

How to estimate a variable's value with static analysis?

I want to write a program to do this, based on Soot's build-in Reaching-Definition analysis. Now I'm wondering is this the correct approach? I searched and found nobody seems to ever be interested in this direction.
Any suggestions?
What you probably want to do is combine a set of ranges using an iterative data flow solver. You want to combine range-values from inputs into range-values for the set of definitions that cross basic blocks.
For this you generally need a control flow graph and the transfer functions across the basic blocks. I suppose you can treat the reaching-definitions graph in a similar way.
You'll then need interprocedural range propagation to push the ranges across the code.
This is a really generic problem you are stating. Reaching Definitions does not have much to do with this. Global Value Numbering is more what you apparently want but it's too hard to tell from your description. Try the Soot mailing list with a more detailed problem statement.

JavaPlot: How can I use the fit method of GNUPlot?

I have a set of 6 points. Now I want to create a trend line (fifth-degree polynomial). I don't have much experience with GNUPlot, yet, but I found the "fit" method which should do exactly what I want. The problem is that I don't know how to call the method within JavaPlot. Even if it wasn't implemented in JavaPlot it should be possible to use that method somehow, right? The JavaPlot website even states:
Moreover, is flexible enough to give special parameters to gnuplot, even if the library does not support it (yet).
Does anyone know how I can plot a fitted (trend) line in JavaPlot?
JavaGnuplotHybrid might be a solution. It allows hybrid programming with Java and gnuplot, which means all gnuplot features are supported. You need to learn some bit about gnuplot first though.
For more details:
Project page: https://github.com/mleoking/JavaGnuplotHybrid
Wikipedia: https://en.wikipedia.org/wiki/JavaGnuplotHybrid

JOpenChart dates on x axis

I am trying to use JOpenChart, unfortunately, the documentation stinks, not even a javadoc as far as I can see.
My problem is that I am trying to use a date on the x axis, and I don't see how this is done. The tutorial implies that I need to use ObjectChartDataModel, but the constructor takes DataSet[] instead of DefaultDataSet[], which is probably fine. I assume one can polymorph to the other (hard to know for sure because, no javadoc is provided), but it takes an Object[] as a second parameter and I have no idea what that is.
Does anyone know this tool that can either answer my question or at least point me at where the documentation exists. The only documentation he seems to offer is this: http://jopenchart.sourceforge.net/tutorial.html which is nice, but doesn't really cover all the bases.
May I suggest http://www.jfree.org/jfreechart/ or if you can afford it http://www.jidesoft.com/products/charts.htm. I've used both and they each have their strengths. The chart you are trying to use I never had much luck with.

How to approach writing algorithm from a complex research paper

I thought of writing a piece of software which does Alpha Compositing. I didn't wanted ready made code off from internet so I tried to find research papers and other sources to understand the mathematical algorithms, and initiated to implement.
But, I got lost very quickly. So my question is,
How should I approach these papers to extract the necessary details from it in order to write algorithm based on it. Any specific set of steps which works well?
Desired answer :
Read ...
Extract ...
Understand ...
Implement ...
Note: This question is not limited to only Alpha Compositing, so more generalised approach will be helpful. I have tagged Java and C++, because thats my desired language to implement the image processing.
What I have done so far?
This is not a homework question but it is of course better to say what I know. I have read wiki of Alpha compositing, and few closely related Image compositing research papers. But, I stuck at the next step to take in order to go from understanding to implementation.
Wikipedia
Technical Memo, Image compositing
I'd recommend reading articles with complex formulas with a pencil and paper. Work through the math involved until you have a good grasp on it. Then, you'll be ready to code.
Start with identifying the steps needed to perform your algorithm on some image data. Include all of the steps from loading the image itself into memory all the way through the complex calculations that you may need to perform. Then structure that list into pseudocode. Once you have that, it should be rather easy to code up.
Write pseudocode. Ideally, the authors of the research papers would have done this, but often they don't. Write pseudocode for some simple language like Matlab or possibly Python, and hack away at writing a working implementation based on the psuedocode.
If you understand some parts of the algorithm but not others, then implement your pseudocode into real code for the parts you understand, and leaving comments for the places you don't.
The section from The Pragmatic Programmer on "Tracer Bullets" basically describes this idea. You want to quickly hack together something that takes your data into some form of an output, and then iterate on the body of the code to get it to slowly resemble the algorithm you're trying to produce.
My answer is necessarily somewhat vague. There's no magic bullet for something like this.
Have you implemented any image processing algorithms? Maybe start with something a little simpler, like desaturation/color intensification, reversal (side to side and upside down), rotating, scaling, and compositing images through a mask.
Once you have those figured out, you will be in a very good position to do an alpha composite.
I agree that academic papers seem to go out of their way to make implementation details muddy and uncertain. I find that large amounts of simplification to what is written is needed to begin to perform a practical implementation. In their haste to be general, writers excessively parameterize every aspect. To build useful, reliable software, it is necessary to start with something simple which actually works so that it can be a framework to add features. To do that, it is necessary to throw away 80–90 percent of the academic generality. Often much can be done with a raft of symbolic constants, but abandoning generality (say for four and five dimensional images) doesn't really lose anything in practice.
My suggestion is to first write the algorithm using Matlab to make sure that you understood all the steps and then try to implement using C++ or java.
To add to the good suggestions above, try to write your pseudocode in simple module (Object oriented style ) so has to have a deep understanding of each part of your code while not loosing the big picture. Writing everything in a procedural way is good a the beginning but as the code grow, it might get become hard to keep up will all you are trying to do.
This example cites one of the seminal works on the topic: Compositing Digital Images by Porter & Duff. The class java.awt.AlphaComposite implements the same rules.

Java library for creating straight skeleton?

I have as an input a 2D polygon with holes, and I need to find it's straight skeleton, like in the picture:
(source: cgal.org)
Maybe there is a good Java library for it?
And if not, can you point me to the good explanation of the algorithm, so I could implement it myself? (I haven't found good resources on Google)
I wrote this a little while back. Not sure if it's robust enough.
https://github.com/twak/campskeleton
(edited for 2018...)
See http://www.sable.mcgill.ca/~dbelan2/roofs/roofs.html which contains an applet.
You may be able to use the JTS Topology Suite. It is a very capable library that I've used on a number of projects - never for straight skeleton, but it may be possible.
Edit:
Ah. I see that "Straight Skeleton" is a technical term. The wikipedia article references several algorithms. Have you looked at those?
As I understand it, you have a (convex?) polygon. From it, you subtract 1 or more (potentially non-convex) polygons. You want to turn the result into a set of polygons without holes. Are there extra rules that you're trying to apply?
I have a hard time coming up with a set of rules from the example that you provided. The outer polygons are non-convex; so it doesn't seem like you're trying to find a convex set to represent the result (which is a relatively common task).
If you could use the breakdown shown below, the algorithm is pretty simple. Can you clarify?
Can I ask u what is your purpose for finding Straight skeleton? Is it personal or commercial? I would be interested in knowing how you r using it to solve real time problems? I do have a java library that does that. My algorithm is listed here http://web.stcloudstate.edu/rsarnath/skeleton/definition.htm

Categories

Resources