https://github.com/guycole/daring-chupacabra
discrete event simulator
https://github.com/guycole/daring-chupacabra
discrete-event-simulation go golang grpc grpc-go kubernetes
Last synced: 6 months ago
JSON representation
discrete event simulator
- Host: GitHub
- URL: https://github.com/guycole/daring-chupacabra
- Owner: guycole
- License: gpl-3.0
- Created: 2022-07-16T19:45:35.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2024-02-02T06:24:52.000Z (about 2 years ago)
- Last Synced: 2025-02-12T23:49:05.444Z (about 1 year ago)
- Topics: discrete-event-simulation, go, golang, grpc, grpc-go, kubernetes
- Language: Go
- Homepage:
- Size: 13.6 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# daring-chupacabra
[Discrete event simulation](https://en.wikipedia.org/wiki/Discrete-event_simulation) implemented in [golang](https://go.dev/) and deploys to [kubernetes](https://kubernetes.io/). You can craft a starting state and let run, or clients can interact with server via [gRPC](https://en.wikipedia.org/wiki/GRPC).
## Goals
1. Portable communication via [gRPC](https://en.wikipedia.org/wiki/GRPC)
1. Deploy to [kubernetes](https://kubernetes.io/)
1. Minimal user interface (CLI)
1. Asynchronous or synchronous operation
1. Turns can be incremented via grpc or run continuously
## Data Structure
1. State
1. Simulation objects are represented by tokens which have a unique ID, a specialization (type) and a life cycle state.
1. Existence: all tokens hava a [CatalogItemType](https://github.com/guycole/daring-chupacabra/blob/main/server/catalog.go) within the [CatalogMap](https://github.com/guycole/daring-chupacabra/blob/main/server/catalog.go).
1. Life Cycle: objects are scheduled, created and optionally deleted. All tokens (even deleted) remain resident within CatalogMap during the simulation (deleted items are removed from other data structures).
1. Location: a 2D grid of [LocationType](https://github.com/guycole/daring-chupacabra/blob/main/server/location.go) represents position within a 2D grid.
1. Clock (Time/Turn)
Time always moves forward. Events can be scheduled up to 99 turns in advance (mod 100). Events are kept within [event_array](https://github.com/guycole/daring-chupacabra/blob/main/server/event_array.go) which manages a list of [event_node](https://github.com/guycole/daring-chupacabra/blob/main/server/event_node.go). Each event_node item represents a scheduled task.
1. Events (Tasks)
Each scheduled event has a token and an action verb.
## Action
1. createAction: create specified object
1. deleteAction: delete specified object
1. moveAction: move specified object
1. nominalAction: turn housekeeping for object
1. nothingAction: do nothing
1. parseAction: parse a command from grpc client
1. scanAction: report on objects around requestor
1. statusAction: report object status