6 namespace org { namespace ldk { namespace structs {
10 * Parameters for configuring [`ProbabilisticScorer`].
12 * Used to configure decay parameters that are static throughout the lifetime of the scorer.
13 * these decay parameters affect the score of the channel penalty and are not changed on a
14 * per-route penalty cost call.
16 public class ProbabilisticScoringDecayParameters : CommonBase {
17 internal ProbabilisticScoringDecayParameters(object _dummy, long ptr) : base(ptr) { }
18 ~ProbabilisticScoringDecayParameters() {
19 if (ptr != 0) { bindings.ProbabilisticScoringDecayParameters_free(ptr); }
23 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
24 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
25 * seen a liquidity estimate update for this amount of time, the historical datapoints are
27 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
29 * Note that after 16 or more half lives all historical data will be completely gone.
31 * Default value: 14 days
33 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
35 public long get_historical_no_updates_half_life() {
36 long ret = bindings.ProbabilisticScoringDecayParameters_get_historical_no_updates_half_life(this.ptr);
42 * If we aren't learning any new datapoints for a channel, the historical liquidity bounds
43 * tracking can simply live on with increasingly stale data. Instead, when a channel has not
44 * seen a liquidity estimate update for this amount of time, the historical datapoints are
46 * For an example of historical_no_updates_half_life being used see [`historical_estimated_channel_liquidity_probabilities`]
48 * Note that after 16 or more half lives all historical data will be completely gone.
50 * Default value: 14 days
52 * [`historical_estimated_channel_liquidity_probabilities`]: ProbabilisticScorer::historical_estimated_channel_liquidity_probabilities
54 public void set_historical_no_updates_half_life(long val) {
55 bindings.ProbabilisticScoringDecayParameters_set_historical_no_updates_half_life(this.ptr, val);
61 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
62 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
63 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
66 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
67 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
68 * struct documentation for more info on the way the liquidity bounds are used.
70 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
71 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
72 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
74 * Default value: 6 hours
78 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
79 * liquidity knowledge will never decay except when the bounds cross.
81 public long get_liquidity_offset_half_life() {
82 long ret = bindings.ProbabilisticScoringDecayParameters_get_liquidity_offset_half_life(this.ptr);
88 * Whenever this amount of time elapses since the last update to a channel's liquidity bounds,
89 * the distance from the bounds to \"zero\" is cut in half. In other words, the lower-bound on
90 * the available liquidity is halved and the upper-bound moves half-way to the channel's total
93 * Because halving the liquidity bounds grows the uncertainty on the channel's liquidity,
94 * the penalty for an amount within the new bounds may change. See the [`ProbabilisticScorer`]
95 * struct documentation for more info on the way the liquidity bounds are used.
97 * For example, if the channel's capacity is 1 million sats, and the current upper and lower
98 * liquidity bounds are 200,000 sats and 600,000 sats, after this amount of time the upper
99 * and lower liquidity bounds will be decayed to 100,000 and 800,000 sats.
101 * Default value: 6 hours
105 * When built with the `no-std` feature, time will never elapse. Therefore, the channel
106 * liquidity knowledge will never decay except when the bounds cross.
108 public void set_liquidity_offset_half_life(long val) {
109 bindings.ProbabilisticScoringDecayParameters_set_liquidity_offset_half_life(this.ptr, val);
115 * Constructs a new ProbabilisticScoringDecayParameters given each field
117 public static ProbabilisticScoringDecayParameters of(long historical_no_updates_half_life_arg, long liquidity_offset_half_life_arg) {
118 long ret = bindings.ProbabilisticScoringDecayParameters_new(historical_no_updates_half_life_arg, liquidity_offset_half_life_arg);
119 GC.KeepAlive(historical_no_updates_half_life_arg);
120 GC.KeepAlive(liquidity_offset_half_life_arg);
121 if (ret >= 0 && ret <= 4096) { return null; }
122 org.ldk.structs.ProbabilisticScoringDecayParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringDecayParameters(null, ret); }
123 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };
127 internal long clone_ptr() {
128 long ret = bindings.ProbabilisticScoringDecayParameters_clone_ptr(this.ptr);
134 * Creates a copy of the ProbabilisticScoringDecayParameters
136 public ProbabilisticScoringDecayParameters clone() {
137 long ret = bindings.ProbabilisticScoringDecayParameters_clone(this.ptr);
139 if (ret >= 0 && ret <= 4096) { return null; }
140 org.ldk.structs.ProbabilisticScoringDecayParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringDecayParameters(null, ret); }
141 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(this); };
146 * Creates a "default" ProbabilisticScoringDecayParameters. See struct and individual field documentaiton for details on which values are used.
148 public static ProbabilisticScoringDecayParameters with_default() {
149 long ret = bindings.ProbabilisticScoringDecayParameters_default();
150 if (ret >= 0 && ret <= 4096) { return null; }
151 org.ldk.structs.ProbabilisticScoringDecayParameters ret_hu_conv = null; if (ret < 0 || ret > 4096) { ret_hu_conv = new org.ldk.structs.ProbabilisticScoringDecayParameters(null, ret); }
152 if (ret_hu_conv != null) { ret_hu_conv.ptrs_to.AddLast(ret_hu_conv); };