Skip to content

Commit 95c25cd

Browse files
authored
Merge pull request #116 from BlockScience/docxs
Docs
2 parents e7152f2 + 7961064 commit 95c25cd

14 files changed

Lines changed: 377 additions & 118 deletions

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
11
[submodule "src/bdp_lib/schemas"]
22
path = src/bdp_lib/schemas
33
url = https://github.com/BlockScience/bdp-schema.git
4+
[submodule "clients/pybdp"]
5+
path = clients/pybdp
6+
url = https://github.com/BlockScience/pybdp.git
7+
[submodule "clients/bdp-typescript"]
8+
path = clients/bdp-typescript
9+
url = https://github.com/BlockScience/bdp-typescript.git
10+
[submodule "front-ends/bdp-frontend"]
11+
path = front-ends/bdp-frontend
12+
url = https://github.com/BlockScience/bdp-frontend.git

LICENSE.md

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
MIT License
2+
3+
Copyright (c) 2025 BlockScience
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

clients/bdp-typescript

Submodule bdp-typescript added at 1cecc18

clients/pybdp

Submodule pybdp added at cf26efb

docs/Canonical Examples.md

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -4,30 +4,30 @@ nav_order: 6
44
layout: default
55
---
66

7-
## Toy Models (WORK IN PROGRESS NOT READY)
7+
- There are numerous toy examples and full canonical examples for illustrating how to get started with the block diagram protocol
88

9-
### 1. Simple Dynamical System Plant
10-
- **Description**: A basic model demonstrating a single processor with a feedback loop.
11-
- **Model JSON**: [simple_model.json](models/simple_model.json)
9+
## Toy Models
1210

13-
### 2. Closed-Loop Control System
14-
- **Description**: A model illustrating a closed-loop control system with a plant, controller, and sensor.
15-
- **Model JSON**: [control_loop_model.json](models/control_loop_model.json)
11+
- The overall repository hosting the toy models can be found [here](https://github.com/BlockScience/bdp-toy-examples)
1612

17-
### 3. Two-Player Game Model
18-
- **Description**: A model representing a two-player game with strategies and payoffs.
19-
- **Model JSON**: [game_model.json](models/game_model.json)
13+
### Composite Processor Mini Example
2014

21-
### 4. Adaptive Strategy Model
22-
- **Description**: This model introduces an adaptive strategy where the decision-making process incorporates learning from past experiences to refine the policy over time.
23-
- **Model JSON**: [adaptive_strategy.json](models/adaptive_strategy.json)
15+
- A simple example which shows how to build up to a composite processor but with a small model
16+
- The notebook can be found [here](https://github.com/BlockScience/bdp-toy-examples/blob/main/Composite%20Processor%20Mini/Composite%20Process%20Mini.ipynb)
2417

25-
### 5. Iterated Game with Learning
26-
- **Description**: An extension of the two-player game model where both players employ adaptive strategies, allowing them to learn and evolve their strategies over multiple iterations.
27-
- **Model JSON**: [iterated_game_with_learning.json](models/iterated_game_with_learning.json)
18+
### Composite Processor Example
2819

29-
## Full Models
20+
- An example of building up a composite processor with a larger subsystem
21+
- The notebook can be found [here](https://github.com/BlockScience/bdp-toy-examples/blob/main/Composite%20Processor%20Mini/Composite%20Process%20Mini.ipynb)
3022

31-
- Placeholder for future full models represented in separate repositories
32-
1. Homicidal Chauffeur
33-
2. KOI?
23+
### Dynamical Systems
24+
25+
- An example of how a saved JSON file can be loaded and used to display five different versions of dynamical systems
26+
- The notebook can be found [here](https://github.com/BlockScience/bdp-toy-examples/blob/main/Dynamical%20Systems/Dynamical%20Systems.ipynb)
27+
28+
## Full Canonical examples
29+
30+
### Homicidal Chauffeur (Work in Progress)
31+
32+
- A canonical example based on the classic "Homicidal Chauffeur" problem
33+
- The repository can be found [here](https://github.com/BlockScience/homicidal-chauffeur-canonical-example)

docs/Functions & Validation Rules/Block Functions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ layout: default
55
parent: Functions & Validation Rules
66
---
77

8-
# Block Functions
8+
# Block Functions
9+
10+
- Currently no specific block functions

docs/Functions & Validation Rules/Processor Functions.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,17 @@ class Processor:
2424
return self.subsystem is None
2525
```
2626

27+
### TypeScript Implementation
28+
29+
```typescript
30+
class Processor {
31+
...
32+
isPrimitive(): boolean {
33+
return this.subsystem === null;
34+
}
35+
}
36+
```
37+
2738
## Get System
2839

2940
$$\text{getSystem}: \text{Processor} \rightarrow \text{System}$$
@@ -45,6 +56,20 @@ class Processor:
4556
return self.subsystem
4657
```
4758

59+
### TypeScript Implementation
60+
61+
```typescript
62+
class Processor {
63+
...
64+
getSystem(): any {
65+
if (this.isPrimitive()) {
66+
return null;
67+
} else {
68+
return this.subsystem;
69+
}
70+
}
71+
}
72+
```
4873

4974
## Get Shape
5075

@@ -61,4 +86,15 @@ class Processor:
6186
...
6287
def get_shape(self):
6388
return self.parent
89+
```
90+
91+
### TypeScript Implementation
92+
93+
```typescript
94+
class Processor {
95+
...
96+
getShape(): Block {
97+
return this.parent;
98+
}
99+
}
64100
```

docs/Functions & Validation Rules/Space Functions.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,6 @@ layout: default
55
parent: Functions & Validation Rules
66
---
77

8-
# Space Functions
8+
# Space Functions
9+
10+
- No space functions currently

0 commit comments

Comments
 (0)