Skip to content

BiksCRN is a small firstorder programming language made to simulate Chemical Reaction Networks, and Chemical protocols. The language paser is made using sablecc

Notifications You must be signed in to change notification settings

Biksbois/BiksCRN

Repository files navigation

BiksCRN

BiksCRN is a first order programming languege used to simulate Chemical Reaction Networks in real time using the Euler method. BiksCRN differece from other similiar languges, with the implementation of chemical protocols and titration. This compiler was made using the SableCC generator, and made in accordance to Aalborg Universitys 4th semesters project.

How get started

When using BiksCrn some preparations are necessary, these will be covered briefly here

Build Project

Firstly when building the .jar file. Click on the file->Project Structure->artifacts. Then click on the plus(+), then clik on the JAR and select the From modules with dependencies. When this is done the main class should be selected in this case it is called com.company.Main. When this is done click ok, and apply the changes and click in the project structure menu. Now click on the build menue and click build.

Python Packages

Since the compiled program will be a .py file it is requirement to install python. When installing python, note that it is important that the boxes for enviorment variables and the pip installation are checked.

After succesful installation, some libaries are need to run the target code. These are as follow:

  • matplotlib
  • itertools
  • math

They can be installed with pip, by writting the following command into CMD:

pip install matplotlib

Executing the .jar

There is a couple diffrent ways to give arguments to the .jar file to tell it which program should be compiled.

  1. Giving the path to the program trough the terminal as a program argument like so "java -jar SableCC_V3.jar [path]"
  2. Dont give it an argument, and follow the intruction given by the compiler.

The path can either be the absolute path or a path relative to the compiler folder. A precompiled version can be found in the BiksZip.zip. Example

Here is a small example off some working code
/* Single line comment */

/*
    Multi line
    comment
*/

    Initialize {
        Sample A {
            Specie X=0, Y=100;
            CRN {
                Y->X, 1;
                X+X -> Y, 2;
            }
            AddMol = X:0.1:while(X<3);
        }
        Sample B {
            Specie C=0, D=10;
            CRN {
                C<->D, 1: 2;
                2C -> 2D, 2;
            }
            RemMol = D:0.3;
        }
        Sample C {
            Specie Q = 1;
        }
    }
    Protocol {
        /*Three possible versions of eqilibrate with a variety of optinal parameteres*/
        Equilibrate A for 100;
        Equilibrate A for 100 t;
        Equilibrate A for 100 by 0.0005 INSTANT;
        Equilibrate A for 100 by 0.0005 each 1000 bitesize 10;
        Sample C = Mix (A,B);
        Sample A,B = C.Split (0.4,0.5);
        A.Dispose();
        B.Dispose(0.5);
    }

About

BiksCRN is a small firstorder programming language made to simulate Chemical Reaction Networks, and Chemical protocols. The language paser is made using sablecc

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •