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.0.tar.gz (36.7 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.0-py3-none-any.whl (23.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: gnps-0.1.0.tar.gz
  • Upload date:
  • Size: 36.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.9 CPython/3.12.10 Windows/11

File hashes

Hashes for gnps-0.1.0.tar.gz
Algorithm Hash digest
SHA256 c262a01fef7aea99f0ae3eddf8dfff79d8de90be141d08501ae743e078dc2043
MD5 cd3c023ba3a2a4bf603b3a8cc49890c0
BLAKE2b-256 709683f70aaf0adc603187ad527a561854de589e5c5d3bb35ab74e7dd7be516b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: gnps-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 23.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.25.9 CPython/3.12.10 Windows/11

File hashes

Hashes for gnps-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 3497453fe50142e09feb73dd40b79c72d7f2702212d3bd6b674935e5f5985dca
MD5 bc25a87a07d80db3ecb0ce24466032e4
BLAKE2b-256 e64c9b3eb865386edf3473ee3c73053702b0c4a4a9a85945b6ed922b2f7aa161

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