Code Monkey home page Code Monkey logo

crnsimul's People

Contributors

andrikz avatar imp4l3r avatar madeyoulookprank avatar rasmusrendal avatar rkjar18 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

crnsimul's Issues

Ignore shebangs / Add comments

In POSIX, you can start a executable file with #!/usr/bin/bash to indicate the file is to be executed in bash. Ideally, we should be able to do the same with the chemilang interpreter. But currently, it tries to interpret the shebang, leading to parser errors.

Ideally, we should just add comments that start with #, but we could also just make a special case to ignore shebangs.

Terminate Markov evaluator

At the moment, the only way the Markov evaluator will mark itself as "finished" is if there are no more reactions possible in the current state. However, most useful CRNs end up in some sort of equilibrium, which the Markov evaluator will just sit on infinitely.

So we either neet some sort of way to detect that we've reached an equilibrium (might be the halting problem in disguise), or just set a cap on the iterations we're willing to perform.

Fill in easy/obvious gaps in test coverage

When #42 gets merged, we can pretty easily see the test coverage. We should use that to try and figure out which parts of the program are not covered by automatic tests, and reduce that as much as possible.

You can see the code coverage for commit 02720c4 here.

Fix floating point summation errors in EulerEvaluator

When you sum n floating points numbers, the errors accumulate at a rate of n. There are compensated summation methods that fix such things.

Although the error mostly won't accumulate in the Euler evaluator due to the fact that it mostly converges to a fixed point, it is still deeply wrong to just use += in large floating point summations. Kahan summation should probably be used to compensate for any floating point errors.

Output to stdout

If we don't have live plotting, we need to have some other way to view what's going on in a non-terminating CRN. Writing to stdout would be a pretty easy way to do that.

Slow down evaluator by default when running the RTPlotter

The random walk example, for instance, goes way too fast for the visualization to be useful. We should probably slow it down by default, and then add a flag for running it in unconstrained mode. This will probably also be nicer on the user's CPU.

Add very basic version of high-level compiler

I think we are at a place now where we can start implementing the high-level compiler. I also think it would be nice if it wasn't me who had to do that.

I think that for the very first version, we just need to accept the following code snippet, or variations thereof:

module main {
    private: [a,b];
    output: [c];
    concentrations: {
        a := 5;
        b := 3;
    }
    reactions: {
        a + b -> a + b + c;
        c -> 0;
    }
}

It should compile to

a := 5;
b := 3;
a + b -> a + b + c;
c -> 0;

The main challenge here is integrating our new code with the CRN parser code without copy-pasting. This will probably require changing the CRN code a lot. (Good thing we have unit tests)

At least you won't have to make up a data structure for module and such (yet)

Add clang-tidy to CI

This is quite difficult. Maybe I should create my own GitHub action, as all the existing ones are bad

Add a command line argument to specify which chemicals should be plotted

For our basic reactions with only two or three species, it's fine that they are all plotted. But if you create big networks, it would be nice if we could say chemilang -p c mul.chem, and only get one of the values. This could eventually be part of the compilation process, adding this argument to the shebang.

The format could be something akin to -p c,a,i,u, ie. a commaseperated list of species names

The syntax does not permit for a CRN with no concentrations

It will crash if there are no initial concentrations in the CRN, and the error message will not be helpful either.

But since reactions of the form 0 -> c are possible, CRNs with no concentrations at all should be possible to define too.

[CRN] Optimize Euler evaluator

There are deep copies everywhere, mostly based on gut feeling. The unit tests should be expanded, so we can remove where they are not used.

Clean up main.cpp

The main function itself should have as little code as possible. But currently it's giant. And the structure of it isn't great either. A rule of thumb for nice, readable code is having at most 2 levels of indentation in your function. We're at 6.

As a sidenote, if you're interested in writing better code, the books "Clean Code" is one I can recommend. Alternatively, Humble Bundle currently has "The art of readable code" for โ‚ฌ1, together with a bunch of other books.

[CRN] Add support for reaction constants

Reaction constants are required to use, for instance, the square root network. The functionality can be replicated by adding the reaction twice, but that is super ugly.

does not work

does not output any text to console when a crn is passed

Add a help argument

If you call the program with -h, --help, or just any invalid arguments, it should present the user a help menu, that documents how the utility is used

time values for plotting

Current plotting uses iterations as x-values, whereas it should use "time".
Time is equivalent to step*iterations.

Add command line argument to enable/disable plot

Ideally, plots should only happen when using the -g flag. Otherwise, you could for example print to stdout.

This will allow for running the software headlessly, which will allow me to do some cool things

Doxygen documentation

Doxygen is a super neat framework for doing a lot of documentation. We just need a doxyfile, a bit of gitignore, and some doxygen comments to get started

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.