Package org.ldk.structs
Class ProbabilisticScoringParameters
- java.lang.Object
-
- org.ldk.structs.ProbabilisticScoringParameters
-
public class ProbabilisticScoringParameters extends Object
Parameters for configuring [`ProbabilisticScorer`].
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description ProbabilisticScoringParametersclone()Creates a copy of the ProbabilisticScoringParametersprotected voidfinalize()longget_liquidity_offset_half_life()The time required to elapse before any knowledge learned about channel liquidity balances is cut in half.longget_liquidity_penalty_multiplier_msat()A multiplier used to determine the amount in msats willing to be paid to avoid routing through a channel, as per multiplying by the negative `log10` of the channel's success probability for a payment.static ProbabilisticScoringParametersof(long liquidity_penalty_multiplier_msat_arg, long liquidity_offset_half_life_arg)Constructs a new ProbabilisticScoringParameters given each fieldstatic Result_ProbabilisticScoringParametersDecodeErrorZread(byte[] ser)Read a ProbabilisticScoringParameters from a byte array, created by ProbabilisticScoringParameters_writevoidset_liquidity_offset_half_life(long val)The time required to elapse before any knowledge learned about channel liquidity balances is cut in half.voidset_liquidity_penalty_multiplier_msat(long val)A multiplier used to determine the amount in msats willing to be paid to avoid routing through a channel, as per multiplying by the negative `log10` of the channel's success probability for a payment.static ProbabilisticScoringParameterswith_default()Creates a "default" ProbabilisticScoringParameters.byte[]write()Serialize the ProbabilisticScoringParameters object into a byte array which can be read by ProbabilisticScoringParameters_read
-
-
-
Method Detail
-
finalize
protected void finalize() throws Throwable
-
get_liquidity_penalty_multiplier_msat
public long get_liquidity_penalty_multiplier_msat()
A multiplier used to determine the amount in msats willing to be paid to avoid routing through a channel, as per multiplying by the negative `log10` of the channel's success probability for a payment. The success probability is determined by the effective channel capacity, the payment amount, and knowledge learned from prior successful and unsuccessful payments. The lower bound of the success probability is 0.01, effectively limiting the penalty to the range `0..=2*liquidity_penalty_multiplier_msat`. The knowledge learned is decayed over time based on [`liquidity_offset_half_life`]. Default value: 10,000 msat [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
-
set_liquidity_penalty_multiplier_msat
public void set_liquidity_penalty_multiplier_msat(long val)
A multiplier used to determine the amount in msats willing to be paid to avoid routing through a channel, as per multiplying by the negative `log10` of the channel's success probability for a payment. The success probability is determined by the effective channel capacity, the payment amount, and knowledge learned from prior successful and unsuccessful payments. The lower bound of the success probability is 0.01, effectively limiting the penalty to the range `0..=2*liquidity_penalty_multiplier_msat`. The knowledge learned is decayed over time based on [`liquidity_offset_half_life`]. Default value: 10,000 msat [`liquidity_offset_half_life`]: Self::liquidity_offset_half_life
-
get_liquidity_offset_half_life
public long get_liquidity_offset_half_life()
The time required to elapse before any knowledge learned about channel liquidity balances is cut in half. The bounds are defined in terms of offsets and are initially zero. Increasing the offsets gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases the certainty of the channel liquidity balance. Default value: 1 hour # Note When built with the `no-std` feature, time will never elapse. Therefore, the channel liquidity knowledge will never decay except when the bounds cross.
-
set_liquidity_offset_half_life
public void set_liquidity_offset_half_life(long val)
The time required to elapse before any knowledge learned about channel liquidity balances is cut in half. The bounds are defined in terms of offsets and are initially zero. Increasing the offsets gives tighter bounds on the channel liquidity balance. Thus, halving the offsets decreases the certainty of the channel liquidity balance. Default value: 1 hour # Note When built with the `no-std` feature, time will never elapse. Therefore, the channel liquidity knowledge will never decay except when the bounds cross.
-
of
public static ProbabilisticScoringParameters of(long liquidity_penalty_multiplier_msat_arg, long liquidity_offset_half_life_arg)
Constructs a new ProbabilisticScoringParameters given each field
-
clone
public ProbabilisticScoringParameters clone()
Creates a copy of the ProbabilisticScoringParameters
-
write
public byte[] write()
Serialize the ProbabilisticScoringParameters object into a byte array which can be read by ProbabilisticScoringParameters_read
-
read
public static Result_ProbabilisticScoringParametersDecodeErrorZ read(byte[] ser)
Read a ProbabilisticScoringParameters from a byte array, created by ProbabilisticScoringParameters_write
-
with_default
public static ProbabilisticScoringParameters with_default()
Creates a "default" ProbabilisticScoringParameters. See struct and individual field documentaiton for details on which values are used.
-
-