Skip to content

Commit

Permalink
Merge pull request cyclus#184 from alexravitz/Commodity-Json
Browse files Browse the repository at this point in the history
Commodity json
  • Loading branch information
scopatz committed Jan 19, 2016
2 parents e986b8e + 18ed6a2 commit 33ae586
Show file tree
Hide file tree
Showing 7 changed files with 156 additions and 0 deletions.
19 changes: 19 additions & 0 deletions source/user/input_specs/archetypes.rst
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,25 @@ defined in :doc:`../find_agents`. For example, `simpleSource` will be found
in a library file with a name such as `libsimpleSource.so`, in the standard
|Cyclus| archetype path.


.. code-block:: json
{
"archetypes": {
"spec": {
"path": "my/custom/path",
"lib": "myAgentCollection",
"alias": "ReactorAgent" },
"spec": {"name": "simpleSource" },
"spec": {"name": "simpleRegion" },
"spec": {"name": "simpleInst" }
}
}
This is what the example above would look like if written in JSON.


.. rst-class:: html-toggle

Grammar Definition
Expand Down
18 changes: 18 additions & 0 deletions source/user/input_specs/commodity.rst
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ A ``commodity`` block has the following sections in the following order:
Example
+++++++

**XML:**

.. code-block:: xml
<commodity>
Expand All @@ -31,11 +33,27 @@ Example
<solution_priority>4.5</solution_priority>
</commodity>
**JSON:**

.. code-block:: json
{"commodity": {
"name": "enriched_u",
"solution_priority": 5.5 }
}
{"commodity": {
"name": "waste",
"solution_priority": 4.5 }
}
In this example, while there may be many commodities used in the problem, two
of them are given explicit priorities. The ``enriched_u`` has the highest
priority followed by ``waste``. Note that these particular names do not imply
any specific composition of the commodity; this will be determined later by
the facilities that trade in these commodities.


.. rst-class:: html-toggle

Expand Down
17 changes: 17 additions & 0 deletions source/user/input_specs/control.rst
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,23 @@ Example
This example starts in November 2007, and runs for 100 years (1200 months).


.. code-block:: json
{
"control": {
"startyear": 2007,
"startmonth": 11,
"duration": 1200,
"dt": 86400,
"decay": "lazy" }
}
This is what the example above would look like if written in JSON.



.. rst-class:: html-toggle

Grammar Definition
Expand Down
25 changes: 25 additions & 0 deletions source/user/input_specs/facility.rst
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,31 @@ lifetime of 720 time steps (60 years) and is based on the archetype with the
name (or alias) `RecipeReactor`. The contents of the ``RecipeReactor``
section are defined by the author of the `RecipeReactor` archetype.


.. code-block:: json
{
"facility": {
"name": "LongTermStorage",
"config": {
"sink": "... archetype-specific input for a `Sink` archetype" }
}
}
{
"facility": {
"name": "PBMR",
"lifetime": 720,
"config": {
"RecipeReactor": "... archetype-specific input for a `RecipeReactor` archetype" }
}
}
This is what the example above would look like if written in JSON.


.. rst-class:: html-toggle

Grammar Definition
Expand Down
24 changes: 24 additions & 0 deletions source/user/input_specs/inst.rst
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,30 @@ the ``FacilityB`` prototype. The second institution has the name
`AnotherInstitution`, is also configured from the archetype with the name (or
alias) ``NullInst``. This institution has no initial facilities.

.. code-block:: json
{
"institution": {
"name": "SingleInstitution",
"initialfacilitylist": [{
"entry": {
"prototype": "FacilityA",
"number": 1}},
{"entry": {"prototype": "FacilityB"}}],
"config": {}
}
}
{
"institution": {
"name": "AnotherInstitution",
"config": {}
}
}
This is what the example above would look like if written in JSON.

.. rst-class:: html-toggle

Grammar Definition
Expand Down
31 changes: 31 additions & 0 deletions source/user/input_specs/recipe.rst
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,37 @@ nuclide of H-1. The second recipe is named `natU_recipe`, is defined using
atom fractions, and contains two nuclides: 0.7% of the atoms are U-235 and
99.3% of the atoms are U-238.


.. code-block:: json
{
"recipe": {
"name": "proton_recipe",
"basis": "mass",
"nuclide": {
"id": "H1",
"comp": 1 }
}
}
{
"recipe": {
"name": "natU_recipe",
"basis": "atom",
"nuclide": {
"id": "U235",
"comp": 0.007 },
"nuclide": {
"id": "U238",
"comp": 0.993 }
}
}
This is what the example above would look like if written in JSON.


.. rst-class:: html-toggle

Grammar Definition
Expand Down
22 changes: 22 additions & 0 deletions source/user/input_specs/region.rst
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,28 @@ is based on the archetype with the name (or alias) `GrowthRegion`. The
contents of the ``GrowthRegion`` section are defined by the author of the
`GrowthRegion` archetype.

.. code-block:: json
{
"region": {
"name": "MyHomeRegion",
"config": { },
"institution": "... data for this institution goes here" }
}
{
"region": {
"name": "MyNeighborRegion",
"config": {
"GrowthRegion": "... archetype-specific input for a `GrowthRegion` archetype" },
"institution": "... data for this institution goes here" }
}
This is what the example above would look like if written in JSON.


.. rst-class:: html-toggle

Grammar Definition
Expand Down

0 comments on commit 33ae586

Please sign in to comment.