Skip to content

Commit

Permalink
fix/NO-TASK (#11)
Browse files Browse the repository at this point in the history
* Added CI tests (#8)

* Updated README.md

* Added github workflow

* Added github workflow

* Added tests

---------

Co-authored-by: danilarassohin <danilarassohin@gmail.com>

* Fix/no task (#10)

* Updated README.md

* Added github workflow

* Added tests

---------

Co-authored-by: danilarassohin <danilarassohin@gmail.com>

---------

Co-authored-by: danilarassohin <danilarassohin@gmail.com>
  • Loading branch information
CrissNamon and danilarassohin committed Mar 24, 2023
1 parent 34bddf4 commit e0e3c8b
Show file tree
Hide file tree
Showing 76 changed files with 1,665 additions and 934 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/maven.yml → .github/workflows/dev.yml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
name: Build
name: Dev test

on:
push:
branches: [ "dev" ]
pull_request:
branches: [ "main", "dev" ]
branches: [ "dev" ]

jobs:
build:
Expand All @@ -19,5 +19,5 @@ jobs:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Build with Maven
- name: Test
run: mvn -B test --file pom.xml
34 changes: 34 additions & 0 deletions .github/workflows/javadoc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: Javadoc

on:
push:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Test
run: mvn -B test --file pom.xml
- name: Generate Javadoc
run: |
mvn -B javadoc:aggregate --file pom.xml
rm -rf compaj-docs
mkdir docs
mkdir docs/javadoc
cd docs
cp -r ../target/site/apidocs/. ./javadoc/
git fetch origin apidocs:apidocs
git checkout apidocs
git add .
git -c user.name='HiddenProject' -c user.email='danilarassokhin@gmail.com' commit -m 'Update docs'
git push --set-upstream origin apidocs
21 changes: 21 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Main test

on:
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Setup JDK 11
uses: actions/setup-java@v3
with:
java-version: '11'
distribution: 'temurin'
cache: maven
- name: Test
run: mvn -B test --file pom.xml
53 changes: 38 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,53 +1,76 @@
# CompaJ Project
[![Build](https://github.com/CrissNamon/compaj/actions/workflows/maven.yml/badge.svg)](https://github.com/CrissNamon/compaj/actions/workflows/maven.yml)

This is the home of the CompaJ Project - open source, cross-platform programming and numeric computing platform for math modelling.
[![Build](https://github.com/CrissNamon/compaj/actions/workflows/main.yml/badge.svg)](https://github.com/CrissNamon/compaj/actions/workflows/main.yml)

This is the home of the CompaJ Project - open source, cross-platform programming and numeric
computing platform for math modelling.

<details>
<summary>Screenshots</summary>
![Terminal](https://user-images.githubusercontent.com/22001123/172052428-5663f5e4-e667-4280-8099-9c0e2f482f1e.png)
![CodeEditor](https://user-images.githubusercontent.com/22001123/172052540-0b28d24e-54f3-4bee-b6a7-996c4bf87538.png)
![WorkSpace](https://user-images.githubusercontent.com/22001123/172052591-0a536b12-2d52-4dde-8a73-af29c178d775.png)

![Terminal](https://user-images.githubusercontent.com/22001123/172052428-5663f5e4-e667-4280-8099-9c0e2f482f1e.png)
![CodeEditor](https://user-images.githubusercontent.com/22001123/172052540-0b28d24e-54f3-4bee-b6a7-996c4bf87538.png)
![WorkSpace](https://user-images.githubusercontent.com/22001123/172052591-0a536b12-2d52-4dde-8a73-af29c178d775.png)
</details>

### Status

___
Project is under active development. CompaJ supports only basic functions and models now, which are not intended to use in real projects.
Project is under active development. CompaJ supports only basic functions and models now, which are
not intended to use in real projects.

### Structure

___
CompaJ has modular structure based on Maven modules.

- [CompaJ Core](https://github.com/CrissNamon/compaj/tree/main/core)
- Core is a library with basic content for CompaJ. It contains simple functions and models.
- [CompaJ Applied](https://github.com/CrissNamon/compaj/tree/main/applied)
- Applied module contains ready to use models.
- [CompaJ Lang](https://github.com/CrissNamon/compaj/tree/main/lang)
- CompaJ Lang is an object oriented and optionally typed programming language based on Groovy with useful extensions to reduce redundant symbols and simplify calculations.
- CompaJ Lang is an object oriented and optionally typed programming language based on Groovy
with useful extensions to reduce redundant symbols and simplify calculations.
- [CompaJ REPL](https://github.com/CrissNamon/compaj/tree/main/repl)
- CompaJ REPL is a console application which provides all functionality of CompaJ Lang.
- [CompaJ](https://github.com/CrissNamon/compaj/tree/main/gui)
- CompaJ is a standalone application with GUI and many useful tools for CompaJ REPL.
- CompaJ is a standalone application with GUI and many useful tools for CompaJ REPL.

### Learn

___

#### Lang
CompaJ uses Groovy under the hood with some tweaks. You can learn Groovy on its official [site](https://groovy-lang.org/documentation.html).
Documentation about CompaJ syntax available in [Wiki](https://github.com/CrissNamon/compaj/wiki/CompaJ-Lang).

CompaJ uses Groovy under the hood with some tweaks. You can learn Groovy on its
official [site](https://groovy-lang.org/documentation.html).
Documentation about CompaJ syntax available
in [Wiki](https://github.com/CrissNamon/compaj/wiki/CompaJ-Lang).

#### Math
CompaJ uses [Apache Commons Math](https://commons.apache.org/proper/commons-math/userguide/index.html) library for math operations. Learn about CompaJ math features in [Wiki](https://github.com/CrissNamon/compaj/wiki/CompaJ-Math).

CompaJ
uses [Apache Commons Math](https://commons.apache.org/proper/commons-math/userguide/index.html)
library for math operations. Learn about CompaJ math features
in [Wiki](https://github.com/CrissNamon/compaj/wiki/CompaJ-Math).

#### Visualization
CompaJ uses widgets system for visualization in _WorkSpace_. Documentation available in [Wiki](https://github.com/CrissNamon/compaj/wiki/CompaJ-WorkSpace)

CompaJ uses widgets system for visualization in _WorkSpace_. Documentation available
in [Wiki](https://github.com/CrissNamon/compaj/wiki/CompaJ-WorkSpace)

#### Other
All documentation and necessary information with tutorials will be released soon.

All documentation and necessary information with tutorials will be released soon.

### Authors

___

* [Danila Rassokhin](https://gihub.com/crissnamon) [![Twitter](https://img.shields.io/twitter/follow/kpekepsalt?style=social)](https://twitter.com/kpekepsalt)

### Copyright

___
CompaJ uses [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0). See [LICENSE.md](https://github.com/CrissNamon/compaj/blob/main/LICENSE.md) for more details.
CompaJ uses [Apache License 2.0](http://www.apache.org/licenses/LICENSE-2.0).
See [LICENSE.md](https://github.com/CrissNamon/compaj/blob/main/LICENSE.md) for more details.
74 changes: 37 additions & 37 deletions applied/pom.xml
Original file line number Diff line number Diff line change
@@ -1,40 +1,40 @@
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<parent>
<artifactId>compaj</artifactId>
<groupId>tech.hiddenproject</groupId>
<version>${revision}</version>
</parent>
<version>${applied.version}</version>
<modelVersion>4.0.0</modelVersion>
<groupId>tech.hiddenproject.compaj</groupId>
<artifactId>applied</artifactId>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>tech.hiddenproject.compaj</groupId>
<artifactId>core</artifactId>
<version>${core.version}</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<executions>
<execution>
<phase>compile</phase>
</execution>
</executions>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
</plugin>
</plugins>
</build>
xmlns="http://maven.apache.org/POM/4.0.0"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<artifactId>applied</artifactId>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<source>11</source>
<target>11</target>
</configuration>
<executions>
<execution>
<phase>compile</phase>
</execution>
</executions>
<groupId>org.apache.maven.plugins</groupId>
</plugin>
</plugins>
</build>
<dependencies>
<dependency>
<artifactId>core</artifactId>
<groupId>tech.hiddenproject.compaj</groupId>
<scope>compile</scope>
<version>${core.version}</version>
</dependency>
</dependencies>
<groupId>tech.hiddenproject.compaj</groupId>
<modelVersion>4.0.0</modelVersion>
<packaging>jar</packaging>
<parent>
<artifactId>compaj</artifactId>
<groupId>tech.hiddenproject</groupId>
<version>${revision}</version>
</parent>
<version>${applied.version}</version>
</project>
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

import java.util.List;
import java.util.Map;

import org.apache.commons.math3.ode.FirstOrderIntegrator;
import org.apache.commons.math3.ode.nonstiff.EulerIntegrator;
import tech.hiddenproject.compaj.core.data.NamedFunction;
import tech.hiddenproject.compaj.core.data.base.RealFunction;
import tech.hiddenproject.compaj.core.model.DynamicFunction;
import tech.hiddenproject.compaj.core.model.base.FirstOrderDifferentialModel;

/**
* Epidemic SEIR model.
*/
public class SEIRModel {

private final FirstOrderDifferentialModel model;
Expand Down Expand Up @@ -45,10 +49,10 @@ public SEIRModel(String name, Double sInit, Double eInit, Double iInit, Double r
model.ad("E", eInit);
model.ad("I", iInit);
model.ad("R", rInit);
S.b(NamedFunction.from(this::susceptible));
E.b(NamedFunction.from(this::exposed));
I.b(NamedFunction.from(this::infected));
R.b(NamedFunction.from(this::recovered));
S.b(DynamicFunction.from(this::susceptible));
E.b(DynamicFunction.from(this::exposed));
I.b(DynamicFunction.from(this::infected));
R.b(DynamicFunction.from(this::recovered));
}

private Double susceptible() {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
package tech.hiddenproject.compaj.applied.epidemic;

import java.util.function.Supplier;

import tech.hiddenproject.compaj.core.data.EnvironmentObject;
import tech.hiddenproject.compaj.core.data.base.GridAgent;
import tech.hiddenproject.compaj.core.data.base.GridLocation;
import tech.hiddenproject.compaj.core.model.base.GridABM;

/**
* Epidemic agent based SIR model.
*/
public class SIRABModel {

private final GridABM gridABM;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

import java.util.List;
import java.util.Map;

import org.apache.commons.math3.ode.FirstOrderIntegrator;
import org.apache.commons.math3.ode.nonstiff.EulerIntegrator;
import tech.hiddenproject.compaj.core.data.NamedFunction;
import tech.hiddenproject.compaj.core.data.base.RealFunction;
import tech.hiddenproject.compaj.core.model.DynamicFunction;
import tech.hiddenproject.compaj.core.model.base.FirstOrderDifferentialModel;

/**
* Epidemic SIRD model.
*/
public class SIRDModel {

private final FirstOrderDifferentialModel model;
Expand Down Expand Up @@ -43,10 +47,10 @@ public SIRDModel(String name, Double sInit, Double iInit, Double rInit, Double d
model.ad("I", iInit);
model.ad("R", rInit);
model.ad("D", dInit);
S.b(NamedFunction.from(this::susceptible));
I.b(NamedFunction.from(this::infected));
R.b(NamedFunction.from(this::recovered));
D.b(NamedFunction.from(this::deceased));
S.b(DynamicFunction.from(this::susceptible));
I.b(DynamicFunction.from(this::infected));
R.b(DynamicFunction.from(this::recovered));
D.b(DynamicFunction.from(this::deceased));
}

private Double susceptible() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

import java.util.List;
import java.util.Map;

import org.apache.commons.math3.ode.FirstOrderIntegrator;
import org.apache.commons.math3.ode.nonstiff.EulerIntegrator;
import tech.hiddenproject.compaj.core.data.NamedFunction;
import tech.hiddenproject.compaj.core.data.base.RealFunction;
import tech.hiddenproject.compaj.core.model.DynamicFunction;
import tech.hiddenproject.compaj.core.model.base.FirstOrderDifferentialModel;

/**
* Epidemic SIR model.
*/
public class SIRModel {

private final FirstOrderDifferentialModel model;
Expand Down Expand Up @@ -37,9 +41,9 @@ public SIRModel(String name, Double sInit, Double iInit, Double rInit) {
model.ad("S", sInit);
model.ad("I", iInit);
model.ad("R", rInit);
S.b(NamedFunction.from(this::susceptible));
I.b(NamedFunction.from(this::infected));
R.b(NamedFunction.from(this::recovered));
S.b(DynamicFunction.from(this::susceptible));
I.b(DynamicFunction.from(this::infected));
R.b(DynamicFunction.from(this::recovered));
}

private Double susceptible() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,16 @@

import java.util.List;
import java.util.Map;

import org.apache.commons.math3.ode.FirstOrderIntegrator;
import org.apache.commons.math3.ode.nonstiff.EulerIntegrator;
import tech.hiddenproject.compaj.core.data.NamedFunction;
import tech.hiddenproject.compaj.core.data.base.RealFunction;
import tech.hiddenproject.compaj.core.model.DynamicFunction;
import tech.hiddenproject.compaj.core.model.base.FirstOrderDifferentialModel;

/**
* Epidemic SIS model.
*/
public class SISModel {

private final FirstOrderDifferentialModel model;
Expand All @@ -32,8 +36,8 @@ public SISModel(String name, Double sInit, Double iInit) {
model.a(S, I);
model.ad("S", sInit);
model.ad("I", iInit);
S.b(NamedFunction.from(this::susceptible));
I.b(NamedFunction.from(this::infected));
S.b(DynamicFunction.from(this::susceptible));
I.b(DynamicFunction.from(this::infected));
}

private Double susceptible() {
Expand Down
Loading

0 comments on commit e0e3c8b

Please sign in to comment.