Giter Site home page Giter Site logo

devs-go's Introduction

Introduction

This is a Parallel DEVS co-simulation engine implementation in Go language, which supports running simulation tasks in single node or distributed enviroment like Kubernetes.

Environment

for development:

  • OS: windows 11 / Linux x64
  • DevTools: Goland 1.19.4 or later

Other environments may be ok, but have not been tested and verified.

Quick Start

Clone this repo and set up GO environment appropriately.
Simulation tasks can be run in a stand-alone or a distributed manner. You can desing and build your own DEVS models by referring to the examples in source code.

stand-alone

Change Directory into this project and type this command:

go run test/testGenr.go

distributed

Change Directory into this project and type this command:

go run test/distributed/node1.go
go run test/distributed/node2.go
go run test/distributed/node3.go
go run test/distributed/testDistributed.go

You will see outputs like this:

node1.go:

served on localhost:8081 ...
generator1 out count0, state is active
generator1: delta int
generator1 out count1, state is hot active
generator1: delta int
generator1 out count2, state is active
generator1: delta int
generator1 out count3, state is hot active
generator1: delta int

node2.go:

served on localhost:8082 ...
transmitter1 out{[{transmitter1 out ##NoTarget ##NoTargetPort data 0}]}, state is active
transmitter1 out{[{transmitter1 out ##NoTarget ##NoTargetPort data 1}]}, state is active
transmitter1 out{[{transmitter1 out ##NoTarget ##NoTargetPort data 2}]}, state is active
transmitter1 out{[{transmitter1 out ##NoTarget ##NoTargetPort data 3}]}, state is active

node3.go

served on localhost:8083 ...
processor1 out job data 0, state is active
processor1 out job data 1, state is active
processor1 out job data 2, state is active
processor1 out job data 3, state is active

testDistributed.go

served on localhost:8080 ...
time advance: 10
time advance: 10
time advance: 14
time advance: 15
time advance: 15
time advance: 19
time advance: 25
time advance: 25
time advance: 29
time advance: 30
time advance: 30
time advance: 34

Cell Automate example

This example only tested on windows 11. Run the commands:

go build -ldflags="-H windowsgui" test/testCA.go
./testCA.exe

运行结果

note: Ensure that x86_64-13.2.0-release-win32-seh-msvcrt-rt_v11webview2 and webview2loader installed!

devs-go's People

Contributors

clouddea avatar

Watchers

 avatar

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.