Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
9a090ce
first attempt at a tariff region. nominally it works
dean-krueger Aug 6, 2025
1afed45
fixed products to look like materials
dean-krueger Aug 6, 2025
f223a9e
removed reference to old friend_regions and enemy_regions vectors
dean-krueger Aug 6, 2025
dcfba68
changelog
dean-krueger Aug 6, 2025
f5d7b56
removed friend/enemy designation and just lumped everything into a si…
dean-krueger Aug 10, 2025
7e84754
made documentation in tariffs entry more clear
dean-krueger Aug 10, 2025
5c6bf1e
changed tariff to adjustment since they can be positive or negative
dean-krueger Aug 10, 2025
9fc9c9d
reworded doc in pragma for adjustments
dean-krueger Aug 19, 2025
7583c75
removed leftover function signatures from an earlier implementation
dean-krueger Aug 19, 2025
0b7a179
templated Adjust<matl/product>bid functions to reduce code duplication
dean-krueger Aug 19, 2025
e69e482
rewrote if (var != nullptr) to if (var)
dean-krueger Aug 19, 2025
ce88ca1
changed variable pref in header to pref_multiplier to better reflect …
dean-krueger Aug 27, 2025
3545250
simplified logic using new cyclus functions from #1914
dean-krueger Aug 27, 2025
486f288
sped up region lookups with new cyclus functions GetRegionList and Ge…
dean-krueger Aug 30, 2025
0776f75
added summary table
dean-krueger Aug 30, 2025
d6b2f7a
cleaned up and simplified code greatly
dean-krueger Aug 30, 2025
7d1c71f
changed some variable names to make them easier to understand, made a…
dean-krueger Nov 12, 2025
ce232f5
refactored entirely to use new datatype from cyclus/cyclus#1922. Stil…
dean-krueger Nov 17, 2025
da1addc
added a check to the config recorder, moved template out of class def…
dean-krueger Nov 17, 2025
e34d274
Merge branch 'main' into tariff-region
dean-krueger Nov 17, 2025
eeb2873
added aliases to the xml schema to let users put in readable names fo…
dean-krueger Nov 18, 2025
bdaee88
Merge branch 'tariff-region' of github.com:dean-krueger/cycamore into…
dean-krueger Nov 18, 2025
e6d6fe3
added all options to the example file
dean-krueger Nov 18, 2025
9cf210d
updated example file to include dummy commodity since we made it so t…
dean-krueger Dec 4, 2025
db1d099
changed to . Went with adjustment instead of tariff since it can go …
dean-krueger Dec 4, 2025
72db1b8
made it so that we should have good coverage for nested tariff region…
dean-krueger Dec 4, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Since last release
======================

**Added:**
* Added TariffRegion Region (#661)
* Added tests for Conversion Facility (#658)
* Added Conversion Facility (#657)
* Replaced manual matl_buy/sell_policy code in storage with code injection (#639)
Expand Down
352 changes: 352 additions & 0 deletions input/tariff_region.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,352 @@
<simulation>
<control>
<duration>12</duration>
<startmonth>1</startmonth>
<startyear>2000</startyear>
</control>

<archetypes>
<spec><lib>cycamore</lib><name>Source</name></spec>
<spec><lib>cycamore</lib><name>Sink</name></spec>
<spec><lib>cycamore</lib><name>Conversion</name></spec>
<spec><lib>cycamore</lib><name>TariffRegion</name></spec>
<spec><lib>agents</lib><name>NullInst</name></spec>
<spec><lib>agents</lib><name>NullRegion</name></spec>
</archetypes>

<!--Start of the Recipe Section (REQUIRED)-->
<recipe>
<name>NaturalUranium</name>
<basis>atom</basis>
<nuclide>
<id>922350000</id>
<comp>0.007204</comp>
</nuclide>
<nuclide>
<id>922380000</id>
<comp>0.992796</comp>
</nuclide>
</recipe>

<!-- Start of the Facility Section (REQUIRED)-->
<facility>
<name>Uranium Mine</name>
<config>
<Source>
<outcommod>Yellowcake</outcommod>
<outrecipe>NaturalUranium</outrecipe>
<throughput>1000</throughput>
</Source>
</config>
</facility>

<facility>
<name>Iron Mine</name>
<config>
<Source>
<outcommod>IronOre</outcommod>
<throughput>1000</throughput>
</Source>
</config>
</facility>

<facility>
<name>Copper Mine</name>
<config>
<Source>
<outcommod>CopperOre</outcommod>
<throughput>1000</throughput>
</Source>
</config>
</facility>

<facility>
<name>Conversion</name>
<config>
<Conversion>
<incommods>
<val>Yellowcake</val>
</incommods>
<outcommod>UF6</outcommod>
<throughput>2000000000</throughput>
</Conversion>
</config>
</facility>

<facility>
<name>Iron Sink</name>
<config>
<Sink>
<in_commods>
<val>IronOre</val>
</in_commods>
<capacity>10000000000</capacity>
</Sink>
</config>
</facility>

<facility>
<name>Copper Sink</name>
<config>
<Sink>
<in_commods>
<val>CopperOre</val>
</in_commods>
<capacity>10000000000</capacity>
</Sink>
</config>
</facility>

<region>
<name>North Korea</name>
<config> <NullRegion /> </config>
<institution>
<name>OneInst</name>
<initialfacilitylist>
<entry>
<prototype>Uranium Mine</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Iron Mine</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Copper Mine</prototype>
<number>1</number>
</entry>
</initialfacilitylist>
<config>
<NullInst/>
</config>
</institution>
</region>

<region>
<name>Russia</name>
<config> <NullRegion /> </config>
<institution>
<name>TwoInst</name>
<initialfacilitylist>
<entry>
<prototype>Uranium Mine</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Iron Mine</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Copper Mine</prototype>
<number>1</number>
</entry>
</initialfacilitylist>
<config>
<NullInst/>
</config>
</institution>
</region>

<region>
<name>United Kingdom</name>
<config> <NullRegion /> </config>
<institution>
<name>ThreeInst</name>
<initialfacilitylist>
<entry>
<prototype>Uranium Mine</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Iron Mine</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Copper Mine</prototype>
<number>1</number>
</entry>
</initialfacilitylist>
<config>
<NullInst/>
</config>
</institution>
</region>

<region>
<name>France</name>
<config> <NullRegion /> </config>
<institution>
<name>FourInst</name>
<initialfacilitylist>
<entry>
<prototype>Uranium Mine</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Iron Mine</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Copper Mine</prototype>
<number>1</number>
</entry>
</initialfacilitylist>
<config>
<NullInst/>
</config>
</institution>
</region>

<region>
<name>Germany</name>
<config> <NullRegion /> </config>
<institution>
<name>FiveInst</name>
<initialfacilitylist>
<entry>
<prototype>Uranium Mine</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Iron Mine</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Copper Mine</prototype>
<number>1</number>
</entry>
</initialfacilitylist>
<config>
<NullInst/>
</config>
</institution>
</region>

<region>
<name>United States</name>
<config>
<TariffRegion>
<adjustment_regions>
<!-- North Korea: blanket 0.10, with specific adjustments for Yellowcake and IronOre -->
<item>
<region>North Korea</region>
<AdjustmentConfig>
<blanket_adjustment>0.10</blanket_adjustment>
<commodity_adjustments>
<item>
<commodity>Yellowcake</commodity>
<adjustment>0.15</adjustment>
</item>
<item>
<commodity>IronOre</commodity>
<adjustment>0.25</adjustment>
</item>
</commodity_adjustments>
</AdjustmentConfig>
</item>
<!-- Russia: blanket 0.20, with specific adjustments for Yellowcake and CopperOre -->
<item>
<region>Russia</region>
<AdjustmentConfig>
<blanket_adjustment>0.20</blanket_adjustment>
<commodity_adjustments>
<item>
<commodity>Yellowcake</commodity>
<adjustment>-0.15</adjustment>
</item>
<item>
<commodity>CopperOre</commodity>
<adjustment>-0.25</adjustment>
</item>
</commodity_adjustments>
</AdjustmentConfig>
</item>
<!-- United Kingdom: blanket 0.30, with specific adjustments for Yellowcake, IronOre, and CopperOre -->
<item>
<region>United Kingdom</region>
<AdjustmentConfig>
<blanket_adjustment>0.30</blanket_adjustment>
<commodity_adjustments>
<item>
<commodity>Yellowcake</commodity>
<adjustment>0.35</adjustment>
</item>
<item>
<commodity>IronOre</commodity>
<adjustment>0.45</adjustment>
</item>
<item>
<commodity>CopperOre</commodity>
<adjustment>0.55</adjustment>
</item>
</commodity_adjustments>
</AdjustmentConfig>
</item>
<!-- France: blanket 0.40, with specific adjustment for Yellowcake -->
<item>
<region>France</region>
<AdjustmentConfig>
<blanket_adjustment>0.40</blanket_adjustment>
<commodity_adjustments>
<item>
<commodity>Yellowcake</commodity>
<adjustment>0.45</adjustment>
</item>
</commodity_adjustments>
</AdjustmentConfig>
</item>
<!-- Germany: blanket -0.10, no commodity-specific adjustments -->
<item>
<region>Germany</region>
<AdjustmentConfig>
<blanket_adjustment>-0.10</blanket_adjustment>
<commodity_adjustments>
<!-- Dummy commodity to allow for no commodity specific
adjustments. There MUST be at least one commodity in this list,
otherwise RelaxNG Error will occur-->
<item>
<commodity>None</commodity>
<adjustment>0.00</adjustment>
</item>
</commodity_adjustments>
</AdjustmentConfig>
</item>
</adjustment_regions>
<!-- Global blanket adjustment: applies to all regions and commodities when no more specific tariff exists -->
<global_blanket_adjustment>0.05</global_blanket_adjustment>
<!-- Global commodity adjustments: apply to all regions for specific commodities when no more specific tariff exists -->
<global_commodity_adjustments>
<item>
<commodity>UF6</commodity>
<adjustment>0.20</adjustment>
</item>
<item>
<commodity>IronOre</commodity>
<adjustment>-0.05</adjustment>
</item>
</global_commodity_adjustments>
</TariffRegion>
</config>
<institution>
<name>SixInst</name>
<initialfacilitylist>
<entry>
<prototype>Conversion</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Iron Sink</prototype>
<number>1</number>
</entry>
<entry>
<prototype>Copper Sink</prototype>
<number>1</number>
</entry>
</initialfacilitylist>
<config>
<NullInst/>
</config>
</institution>
</region>

</simulation>
2 changes: 2 additions & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,8 @@ USE_CYCLUS("cycamore" "manager_inst")

USE_CYCLUS("cycamore" "growth_region")

USE_CYCLUS("cycamore" "tariff_region")

USE_CYCLUS("cycamore" "storage")

INSTALL_CYCLUS_MODULE("cycamore" "" "NONE")
Expand Down
Loading
Loading