Skip to main content

Generalized Numerical P Systems simulator package

Project description

GNPS project

The GNPS project (Generalized Numerical P Systems) aims to create a library for simulation of different variants of Numerical P Systems (NPS).

It contains:

  • GNPS core (the core classes for NPS simulation)
  • GNPS parser (parsers for different inputs)
  • GNPS generator (generates outputs, i.e. Verilog, Amaranth and Lustre) work in progress.
  • Utils (like the main runner)

Input Files

  • System description: YAML file describing the GNPS system (required as the first argument).
  • Input file: Optional CSV file, each row representing input variable values for a simulation step. The header must match the input variable names defined in the YAML.
  • Output file: Optional CSV file, each row representing output variable values for each step.

Command Line Options

Run the simulator with:

python -m gnps <gnps_file.yaml> [input.csv] [output.csv] [options]

Options:

  • -c, --compute_mode Run in continuous compute mode (no input variables allowed)

  • -s, --steps N Number of steps to run (default: 1)

  • --csv Output in CSV format in continuous compute mode

  • gnps_file (YAML): Required. GNPS system description.

  • input (CSV): Optional. Input values per step (default: stdin).

  • output (CSV): Optional. Output values per step (default: stdout).

Modes

  • IO mode (default): Reads input variables from CSV for each step, writes output variables for each step.
  • Continuous compute mode: Runs for a set number of steps without input variables, outputs results at each step (CSV or text).

Example Input YAML

Below is an example of a GNPS system description in YAML format (from test_math_functions.yaml):

description: "A test system"

cells:
  - id: 1
    contents:
      - x = 0, y = 0, E = 0, z = 0, u = 1
      # Comments can be added like this
    # input variables should be empty for continuous compute mode
    input: [u] 
    output: [x,y,z]

rules:
  - E > x | x + 3 -> x  # guarded rule
  - E + 1 -> E         # unguarded rule
  - 0*z + x + y -> z
  - (E > u || E > x || E > y) | u + x + y -> y                                   # step will be reset to 0

For more details, see the CHANGELOG.md and documentation in the docs/ folder.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

gnps-0.1.3.tar.gz (35.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

gnps-0.1.3-py3-none-any.whl (23.4 kB view details)

Uploaded Python 3

File details

Details for the file gnps-0.1.3.tar.gz.

File metadata

  • Download URL: gnps-0.1.3.tar.gz
  • Upload date:
  • Size: 35.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.9 CPython/3.12.11 Linux/6.1.0-40-amd64

File hashes

Hashes for gnps-0.1.3.tar.gz
Algorithm Hash digest
SHA256 793c900fb34a993a2c296992c380c1283e8c4a7b93aa5fcdfb4f81a1c2ffc55f
MD5 04c17f752f980d2429c5dd1b5c71d25c
BLAKE2b-256 a76ce6ae02e9d9cb40ceb0d168f6c8eb748caad1b4b7126263f7949bb1ab3241

See more details on using hashes here.

File details

Details for the file gnps-0.1.3-py3-none-any.whl.

File metadata

  • Download URL: gnps-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 23.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.9 CPython/3.12.11 Linux/6.1.0-40-amd64

File hashes

Hashes for gnps-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 b42d876037401efae823628ae18b14cda7c716aba0ecf2340290d967296838ab
MD5 173a4f0d1460f6869b00b9ddae5c2bff
BLAKE2b-256 659ab1f33000299d01d4d23b1c11085525640f4f7fb26f1fec7ed3058740db91

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page