SCALAble SimulaTION - ScalaTion

Papers | Scaladoc | Source Code

Welcome to ScalaTion, the Scala-based system for Simulation, Optimization and Analytics.

This system, coded in Scala, supports multi-paradigm simulation modeling including 'tableau', 'event', 'process', 'dynamics', 'dynamics_pde', 'activity' and 'state' oriented models.

Scala is a modern object-oriented, functional programming language that is well-suited for developing simulation engines. It is in the Java family of languages and can call Java code. The inclusion of advanced and functional programming capabilities, makes the code much more concise than Java. ScalaTion also supports optimization and analytics as they nowadays go hand-in-hand with simulation modeling. Some of the algorithms come in both sequential and parallel versions.

The ScalaTion 1.7 version defines multiple .par subpackages that contain parallel versions of sequential algorithms. Future directions include completing the 'scala3d' and 'physics' packages.

As of version 1.7, ScalaTion consists of five subprojects: scalation_mathematics, scalation_statistics, scalation_database, scalation_modeling and scalation_models

Please read the LICENSE file (an MIT style license).


Installation Instructions

Requires: Scala 2.13.6 and Java 11+
Recommended: sbt   (see Setup.html)
Getting started: sbt Hello, World

1. Download one of the following two files

scalation_1.7.tar.gz
OR
scalation_1.7.zip

2. Untar or unzip the file


$ tar xvfz scalation_1.7.tar.gz 
OR
$ unzip scalation_1.7.zip

3. To build all the modules, change into the ScalaTion base directory and run the build_all.sh shell script


$ cd scalation_1.7 
$ ./build_all.sh

4. To compile code or run apps, change into one of the module directories, enter sbt and type compile, runMain or exit


$ cd scalation_modeling 
$ sbt
> compile
> runMain scalation.analytics.SimpleRegressionTest
> runMain scalation.analytics.RegressionTest
> runMain scalation.analytics.PredictorMatTest
> exit

The compile command is optional, since runMain will automatically compile if need be.

ScalaTion is set up to use the Simple Build Tool sbt. ScalaTion 1.7 uses the following five build specification files (one for each module):

  1. scalation_mathematics: build.sbt,
  2. scalation_statistics: build.sbt,
  3. scalation_database: build.sbt,
  4. scalation_modeling: build.sbt and
  5. scalation_models: build.sbt.
Source packages are in the src/main/scala directory, class files are in the target/scala-2.13/classes directory, and documentation files are in the target/scala-2.13/api directory. Unmanaged jar files are stored in a common library ../lib directory, lib. Data file input, output or analytics are stored in subdirectories of data, while database files are stored in store.

5. To develop projects that use ScalaTion that are outside ScalaTion do the following


$ cd your_project_dir 
$ sbt new sbt/scala-seed.g8
$ cd hello
$ mkdir lib
copy jar files from lib
$ cd src/main/scala/example
$ vim Hello.scala
The second time you do this, you will want to use a more appropriate name than hello.


To develop using an Integrated Development Environment (IDE) [Eclipse or IntelliJ]:

  1. Download Scala IDE for Eclipse
  2. Extract the downloaded .zip/.tar.gz file
  3. Start eclipse by running the eclipse command or clicking eclipse application from the file manager
  4. Create and run HelloWorld.scala, see tutorial

For more information about the source code, see src/README_src.hmtl.


Papers/Documentation

  1. John A. Miller, Jun Han and Maria Hybinette, "Using Domain Specific Languages for Modeling and Simulation: ScalaTion as a Case Study," Proceedings of the 2010 ACM/IEEE Winter Simulation Conference (WSC'10), Baltimore, Maryland (December 2010) pp. 741-752.

  2. Michael E. Cotterell, John A. Miller, Tom Horton, "Unicode in Domain-Specific Programming Languages for Modeling & Simulation: ScalaTion as a Case Study," Arxiv preprint arXiv:1112.175 (December 2011) pp. 1-10.

  3. Michael E. Cotterell, John A. Miller, Jun Han and Tom Horton, "Extending ScalaTion, a Domain-Specific Language for Modeling & Simulation, for Simulation Optimization," Proceedings of the AlaSim International Modeling and Simulation Conference & Exhibition (AlaSim'12), Huntsville, Alabama (May 2012) pp. 1-1.

  4. Yung Long Li, "Evaluation of Parallel Implementations of Dense and Sparse Matrices for the ScalaTion Library," Technical Report, University of Georgia (December 2012) pp. 1-60.

  5. John A. Miller, Michael E. Cotterell and Stephen J. Buckley, "Supporting a Modeling Continuum in ScalaTion: From Predictive Analytics to Simulation Modeling," Proceedings of the 2013 ACM/IEEE Winter Simulation Conference (WSC'13), Washington, DC (December 2013) pp. 1191-1202.

  6. Matthew Saltz, Ayushi Jain, Abhishek Kothari, Arash Fard, John A. Miller, and Lakshmish Ramaswamy, "DualIso: An Algorithm for Subgraph Pattern Matching on Very Large Labeled Graphs," Proceedings of the 3rd IEEE International Congress on Big Data (BigData'14), Anchorage, Alaska (June-July 2014) pp. 498-505.
    Online supplement


Source Packages (doc)

Package Description
MATHEMATICS The scalation_mathematics module provides foundational packages for mathematics needed for modeling.
scalation.linalgebra The `linalgebra` package contains classes, traits and objects for linear algebra, including vectors and matrices for real and complex numbers.
- scalation.linalgebra.bld The `bld` package contains traits and objects for generating source code for vector classes, matrix traits and matrix classes.
- scalation.linalgebra.gen The `gen` package contains generic classes, traits and objects for linear algebra, including vectors and matrices for types implementing `Numeric`. Tend to run more slowly than the specialized versions in `linalgebra`.
- scalation.linalgebra.mem_mapped The `mem_mapped` package contains classes, traits and objects for out-of-core linear algebra, including vectors and matrices for real and complex numbers.
- - scalation.linalgebra.mem_mapped.bld The `bld` package contains traits and objects for generating source code for out-of-core vector classes, matrix traits and matrix classes.
- scalation.linalgebra.par The `par` package contains classes, traits and objects for parallel linear algebra, including vectors and matrices for real and complex numbers.
scalation.math The `math` package contains classes, traits and objects for common mathematical operations. Its package object defines exponentiation, logarithmic, trigonometric, etc. operators and functions.
scalation.util The `util` package contains classes, traits and objects for basic utility functions.
- scalation.util.bld The `bld` package contains traits and objects for generating source code for memory mapped arrays.
STATISTICS The scalation_statistics module provides foundational packages for statistics needed for modeling.
scalation.par The `par` package contains classes, traits and objects for parallel processing techniques such as Map-Reduce.
scalation.plot The `plot` package contains classes, traits and objects for simple plotting of x-y data.
scalation.random The `random` package contains classes, traits and objects for the generation of random numbers.
scalation.scala2d The `scala2d` package contains classes, traits and objects for for simple 2D graphics in scala, based upon `java.swing`, `java.awt` and `java_awt_geom`.
scalation.stat The `stat` package contains classes, traits and objects for basic statistical functions and analyses. The package object itself defines an implicit conversion from `scalation.linalgebra.VectorD` to `StatVector`.
scalation.tenalgebra The `tenalgebra` package contains classes, traits and objects for tensor algebra.
DATABASE The scalation_database module provides packages for efficient data management in support of analytics.
scalation.columnar_db The `columar_db` package contains classes, traits and objects for columnar relational databases where columns are vectors from the `linalgebra` package.
scalation.graphalytics The `graphalytics` package contains classes, traits and objects for graph analytics (especially graph pattern matching) on Trees, 'DAG's and Directed Graphs.
scalation.graph_db The `graph_db` package contains classes, traits and objects for graph databases.
- scalation.graph_db.graph_algebra The `graph_algebra` package provide graph algebra operators for graph databases.
- scalation.graph_db.pattern_matching The `pattern_matching` package contains classes, traits and objects for graph pattern matching such as graph simulation and subgraph isomorphism suitable for interfacing with graph databases.
- - scalation.graph_db.pattern_matching.test The `test` package contains classes for testing graph pattern matching algorithms.
scalation.image The `image` package contains classes, traits and objects for image processing and computer vision.
scalation.scala3d The `scala3d` package contains classes, traits and objects for simple 3D graphics in scala, based upon javafx. Its package object contains type aliases for 'javafx.geometry.Point3D' and all subclasses of 'javafx.scene.shape.Shape3D'.
scalation.spatial The `spatial` package contains classes, traits and objects for spatial coordinates.
MODELING The scalation_modeling module provides packages with modeling techniques for analytics, mathematical and simulation models.
scalation.activity The `activity` package contains classes, traits and objects for activity-oriented simulation models (for example, Petri Nets).
scalation.analytics The `analytics` package contains classes, traits and objects for predictive analytics.
- scalation.analytics.classifier The `classifier` package contains classes, traits and objects for analytics focused on classification.
- - scalation.analytics.classifier.par The `par` package contains classes, traits and objects for analytics focused on classification with parallel implementations.
- scalation.analytics.clusterer The `clusterer` package contains classes, traits and objects for clustering algorithms.
- scalation.analytics.fda The `fda` package contains classes, traits and objects for Functional Data Analysis (FDA).
- scalation.analytics.forecaster The `forecaster` package contains classes, traits and objects for Forescasting and Time Series Analysis.
- scalation.analytics.par The `par` package contains classes, traits and objects for predictive analytics with parallel implementations.
- scalation.analytics.recommender The `recommender` package contains classes, traits and objects of recommendation systems.
scalation.animation The `animation` package contains classes, traits and objects for 2D animation of simulation objects.
scalation.calculus The `calculus` package contains classes with methods for computing derivatives, gradient vectors, Jacobian matrices, integrals and basic operators in Functional Analysis.
scalation.dynamics The `dynamics` package contains classes, traits and objects for system dynamics simulations using Ordinary Differential Equations (ODEs).
scalation.dynamics_pde The `dynamics_pde` package contains classes, traits and objects for system dynamics simulations using Partial Differential Equations 'PDE's.
scalation.event The `event` package contains classes, traits and objects for event oriented simulation models (for example, event scheduling or event graphs).
scalation.maxima The `maxima` package contains classes, traits and objects for optimization to find maxima.
scalation.minima The `minima` package contains classes, traits and objects for optimization to find minima.
scalation.model The `model` package contains a trait giving a template for models to follow.
scalation.queueingnet The `queueingnet` package contains classes, traits and objects for solving simple queueing network problems.
scalation.physics The `physics` package contains classes, traits and objects for for simulation oriented games. It utilizes ODE and PDE solvers from the scalation package to move objects in either 2D or 3D canvases/scene graphs. @see buildnewgames.com/gamephysics/
scalation.process The `process` package contains classes, traits and objects for process-oriented simulation models (for example, process-interaction).
scalation.state The `state` package contains classes, traits and objects for state-oriented simulation models (for example, Markov Chains).
scalation.tableau The `tableau` package contains classes for tableau oriented simulation models (similar to spreadsheet simulations).
MODELS The scalation_models module provides packages demonstrating various modeling applications.
apps.activity The `activity` package contains example applications for activity oriented simulation models.
apps.analytics The `analytics` package contains example applications for analytics: prediction, classification or clustering.
apps.database The `database` package contains applications of databases.
apps.dynamics The `dynamics` package contains example applications for continuous simulation models based on Ordinary Differential Equations 'ODE's or Partial Differential Equations 'PDE's.
apps.event The `event` package contains example applications for event oriented simulation models.
apps.game The `game` package contains example applications for simulation oriented games.
apps.montecarlo The `montecarlo` package contains example applications for Monte Carlo Simulation.
apps.optimization The `optimization` package contains example applications for finding solutions (minima or maxima) to optimization problems.
apps.process The `process` package contains example applications for process oriented simulation models.
apps.simopt The `simopt` package contains example applications for simulation optimization.
apps.state The `state` package contains example applications for state oriented simulation models.
apps.tableau The `tableau` package contains example applications for tableau oriented simulation models.

Source Packages (src)

Package Description
MATHEMATICS The scalation_mathematics module provides foundational packages for mathematics needed for modeling.
scalation.linalgebra The `linalgebra` package contains classes, traits and objects for linear algebra, including vectors and matrices for real and complex numbers.
- scalation.linalgebra.bld The `bld` package contains traits and objects for generating source code for vector classes, matrix traits and matrix classes.
- scalation.linalgebra.gen The `gen` package contains generic classes, traits and objects for linear algebra, including vectors and matrices for types implementing `Numeric`. Tend to run more slowly than the specialized versions in `linalgebra`.
- scalation.linalgebra.mem_mapped The `mem_mapped` package contains classes, traits and objects for out-of-core linear algebra, including vectors and matrices for real and complex numbers.
- - scalation.linalgebra.mem_mapped.bld The `bld` package contains traits and objects for generating source code for out-of-core vector classes, matrix traits and matrix classes.
- scalation.linalgebra.par The `par` package contains classes, traits and objects for parallel linear algebra, including vectors and matrices for real and complex numbers.
scalation.math The `math` package contains classes, traits and objects for common mathematical operations. Its package object defines exponentiation, logarithmic, trigonometric, etc. operators and functions.
scalation.util The `util` package contains classes, traits and objects for basic utility functions.
- scalation.util.bld The `bld` package contains traits and objects for generating source code for memory mapped arrays.
STATISTICS The scalation_statistics module provides foundational packages for statistics needed for modeling.
scalation.par The `par` package contains classes, traits and objects for parallel processing techniques such as Map-Reduce.
scalation.plot The `plot` package contains classes, traits and objects for simple plotting of x-y data.
scalation.random The `random` package contains classes, traits and objects for the generation of random numbers.
scalation.scala2d The `scala2d` package contains classes, traits and objects for for simple 2D graphics in scala, based upon `java.swing`, `java.awt` and `java_awt_geom`.
scalation.stat The `stat` package contains classes, traits and objects for basic statistical functions and analyses. The package object itself defines an implicit conversion from `scalation.linalgebra.VectorD` to `StatVector`.
scalation.tenalgebra The `tenalgebra` package contains classes, traits and objects for tensor algebra.
DATABASE The scalation_database module provides packages for efficient data management in support of analytics.
scalation.columnar_db The `columar_db` package contains classes, traits and objects for columnar relational algebra, where columns are vectors from the `linalgebra` package.
scalation.graphalytics The `graphalytics` package contains classes, traits and objects for graph analytics on Trees, 'DAG's and Directed Graphs. It provides an implicit conversion when needed for converting doubles to vectors.
scalation.graph_db The `graph_db` package contains classes, traits and objects for graph analytics on Trees, 'DAG's and Directed Graphs. It provides an implicit conversion when needed for converting doubles to vectors.
- scalation.graph_db.graph_algebra The `graph_algebra` package provide graph algebra operators.
- scalation.graph_db.pattern_matching The `pattern_matching` package contains classes, traits and objects for graph pattern matching such as graph simulation and subgraph isomorphism.
- - scalation.graph_db.pattern_matching.test The `test` package contains classes for testing graph pattern matching algorithms.
scalation.image The `image` package contains classes, traits and objects for image processing and computer vision.
scalation.scala3d The `scala3d` package contains classes, traits and objects for simple 3D graphics in scala, based upon javafx. Its package object contains type aliases for 'javafx.geometry.Point3D' and all subclasses of 'javafx.scene.shape.Shape3D'.
scalation.spatial The `spatial` package contains classes, traits and objects for spatial coordinates.
MODELING The scalation_modeling module provides packages with modeling techniques for analytics, mathematical and simulation models.
scalation.activity The `activity` package contains classes, traits and objects for activity-oriented simulation models (for example, Petri Nets).
scalation.analytics The `analytics` package contains classes, traits and objects for predictive analytics.
- scalation.analytics.classifier The `classifier` package contains classes, traits and objects for analytics focused on classification.
- - scalation.analytics.classifier.par The `par` package contains classes, traits and objects for analytics focused on classification with parallel implementations.
- scalation.analytics.clusterer The `clusterer` package contains classes, traits and objects for clustering algorithms.
- scalation.analytics.fda The `fda` package contains classes, traits and objects for Functional Data Analysis (FDA).
- scalation.analytics.forecaster The `forecaster` package contains classes, traits and objects for Forecasting and Time Series Analysis.
- scalation.analytics.par The `par` package contains classes, traits and objects for parallel analytics including clustering and prediction.
- scalation.analytics.recommender The `recommender` package contains classes, traits and objects of recommendation systems.
scalation.animation The `animation` package contains classes, traits and objects for 2D animation of simulation objects.
scalation.calculus The `calculus` package contains classes with methods for computing derivatives, gradient vectors, Jacobian matrices, integrals and basic operators in Functional Analysis.
scalation.dynamics The `dynamics` package contains classes, traits and objects for system dynamics simulations using Ordinary Differential Equations (ODEs).
scalation.dynamics_pde The `dynamics_pde` package contains classes, traits and objects for system dynamics simulations using Partial Differential Equations 'PDE's.
scalation.event The `event` package contains classes, traits and objects for event oriented simulation models (for example, event scheduling or event graphs).
scalation.maxima The `maxima` package contains classes, traits and objects for optimization to find maxima.
scalation.minima The `minima` package contains classes, traits and objects for optimization to find minima.
scalation.model The `model` package contains a trait giving a template for models to follow.
scalation.queueingnet The `queueingnet` package contains classes, traits and objects for solving simple queueing network problems.
scalation.physics The `physics` package contains classes, traits and objects for for simulation oriented games. It utilizes ODE and PDE solvers from the scalation package to move objects in either 2D or 3D canvases/scene graphs. @see buildnewgames.com/gamephysics/
scalation.process The `process` package contains classes, traits and objects for process-oriented simulation models (for example, process-interaction).
scalation.state The `state` package contains classes, traits and objects for state-oriented simulation models (for example, Markov Chains).
scalation.tableau The `tableau` package contains classes for tableau oriented simulation models (similar to spreadsheet simulations).
MODELS The scalation_models module provides packages demonstrating various modeling applications.
apps.activity The `activity` package contains example applications for activity oriented simulation models.
apps.analytics The `analytics` package contains example applications for analytics: prediction, classification or clustering.
apps.database The `database` package contains applications of databases.
apps.dynamics The `dynamics` package contains example applications for continuous simulation models based on Ordinary Differential Equations 'ODE's or Partial Differential Equations 'PDE's.
apps.event The `event` package contains example applications for event oriented simulation models.
apps.game The `game` package contains example applications for simulation oriented games.
apps.montecarlo The `montecarlo` package contains example applications for Monte Carlo Simulation.
apps.optimization The `optimization` package contains example applications for finding solutions (minima or maxima) to optimization problems.
apps.process The `process` package contains example applications for process oriented simulation models.
apps.simopt The `simopt` package contains example applications for simulation optimization.
apps.state The `state` package contains example applications for state oriented simulation models.
apps.tableau The `tableau` package contains example applications for tableau oriented simulation models.
MATH AND STAT UNIT TESTS Unit Tests for the scalation_mathematics module
testing.linalgebra Unit tests for the `linalgebra` package.
testing.stat Unit tests for the `stat` package.

Code Release Process


$ cd scalation_1.7 
$ cd scalation_mathematics
$ sbt
> compile
> package
> test
> runMain scalation.util.RunSpellCheck 'package-directory'
> runMain scalation.GenIndexHtml
> clean
> doc
> exit
Similarly for scalation_statistics, scalation_database, scalation_modeling and scalation_models. Script files: release.sh, build_all.sh, build_modeling.sh