Skip to content

Commit 9df4318

Browse files
committed
Move default production key for reaction to constant
1 parent 6974618 commit 9df4318

File tree

1 file changed

+3
-2
lines changed
  • controls-constructor/src/commonMain/kotlin/space/kscience/controls/constructor/models/continuous

1 file changed

+3
-2
lines changed

controls-constructor/src/commonMain/kotlin/space/kscience/controls/constructor/models/continuous/ContinuousReaction.kt

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,15 @@ import space.kscience.dataforge.context.Context
1919
public interface ReactionRule<U : UnitsOfMeasurement, T : Amount<U>> {
2020
public val supplyKeys: Collection<String>
2121

22-
public val productKey: String
22+
public val productKey: String get() = DEFAULT_PRODUCT_KEY
2323

2424
public fun forward(input: Map<String, T>): T
2525

2626
public fun backward(output: Amount<U>): Map<String, Numeric<U>>
2727

2828
public companion object {
2929

30+
public const val DEFAULT_PRODUCT_KEY: String = "@product"
3031

3132
/**
3233
* @param formula components needed to produce [production] of resulting substance
@@ -35,7 +36,7 @@ public interface ReactionRule<U : UnitsOfMeasurement, T : Amount<U>> {
3536
algebra: AmountAlgebra<U, T>,
3637
formula: Map<String, Numeric<U>>,
3738
production: T = algebra.one,
38-
productKey: String = "@product"
39+
productKey: String = DEFAULT_PRODUCT_KEY
3940
): ReactionRule<U, T> = object : ReactionRule<U, T> {
4041

4142
init {

0 commit comments

Comments
 (0)