routerrpc.MissionControlConfig.scala Maven / Gradle / Ivy
The newest version!
// Generated by the Scala Plugin for the Protocol Buffer Compiler.
// Do not edit!
//
// Protofile syntax: PROTO3
package routerrpc
/** @param halfLifeSeconds
*
* Deprecated, use AprioriParameters. The amount of time mission control will
* take to restore a penalized node or channel back to 50% success probability,
* expressed in seconds. Setting this value to a higher value will penalize
* failures for longer, making mission control less likely to route through
* nodes and channels that we have previously recorded failures for.
* @param hopProbability
*
* Deprecated, use AprioriParameters. The probability of success mission
* control should assign to hop in a route where it has no other information
* available. Higher values will make mission control more willing to try hops
* that we have no information about, lower values will discourage trying these
* hops.
* @param weight
*
* Deprecated, use AprioriParameters. The importance that mission control
* should place on historical results, expressed as a value in [0;1]. Setting
* this value to 1 will ignore all historical payments and just use the hop
* probability to assess the probability of success for each hop. A zero value
* ignores hop probability completely and relies entirely on historical
* results, unless none are available.
* @param maximumPaymentResults
*
* The maximum number of payment results that mission control will store.
* @param minimumFailureRelaxInterval
*
* The minimum time that must have passed since the previously recorded failure
* before we raise the failure amount.
* @param model
*
* ProbabilityModel defines which probability estimator should be used in
* pathfinding. Note that the bimodal estimator is experimental.
*/
@SerialVersionUID(0L)
final case class MissionControlConfig(
@scala.deprecated(message="Marked as deprecated in proto file", "") halfLifeSeconds: _root_.scala.Long = 0L,
@scala.deprecated(message="Marked as deprecated in proto file", "") hopProbability: _root_.scala.Float = 0.0f,
@scala.deprecated(message="Marked as deprecated in proto file", "") weight: _root_.scala.Float = 0.0f,
maximumPaymentResults: _root_.scala.Int = 0,
minimumFailureRelaxInterval: _root_.scala.Long = 0L,
model: routerrpc.MissionControlConfig.ProbabilityModel = routerrpc.MissionControlConfig.ProbabilityModel.APRIORI,
estimatorConfig: routerrpc.MissionControlConfig.EstimatorConfig = routerrpc.MissionControlConfig.EstimatorConfig.Empty,
unknownFields: _root_.scalapb.UnknownFieldSet = _root_.scalapb.UnknownFieldSet.empty
) extends scalapb.GeneratedMessage with scalapb.lenses.Updatable[MissionControlConfig] {
@transient
private[this] var __serializedSizeMemoized: _root_.scala.Int = 0
private[this] def __computeSerializedSize(): _root_.scala.Int = {
var __size = 0
{
val __value = halfLifeSeconds
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(1, __value)
}
};
{
val __value = hopProbability
if (__value != 0.0f) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeFloatSize(2, __value)
}
};
{
val __value = weight
if (__value != 0.0f) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeFloatSize(3, __value)
}
};
{
val __value = maximumPaymentResults
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt32Size(4, __value)
}
};
{
val __value = minimumFailureRelaxInterval
if (__value != 0L) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeUInt64Size(5, __value)
}
};
{
val __value = model.value
if (__value != 0) {
__size += _root_.com.google.protobuf.CodedOutputStream.computeEnumSize(6, __value)
}
};
if (estimatorConfig.apriori.isDefined) {
val __value = estimatorConfig.apriori.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
if (estimatorConfig.bimodal.isDefined) {
val __value = estimatorConfig.bimodal.get
__size += 1 + _root_.com.google.protobuf.CodedOutputStream.computeUInt32SizeNoTag(__value.serializedSize) + __value.serializedSize
};
__size += unknownFields.serializedSize
__size
}
override def serializedSize: _root_.scala.Int = {
var __size = __serializedSizeMemoized
if (__size == 0) {
__size = __computeSerializedSize() + 1
__serializedSizeMemoized = __size
}
__size - 1
}
def writeTo(`_output__`: _root_.com.google.protobuf.CodedOutputStream): _root_.scala.Unit = {
{
val __v = halfLifeSeconds
if (__v != 0L) {
_output__.writeUInt64(1, __v)
}
};
{
val __v = hopProbability
if (__v != 0.0f) {
_output__.writeFloat(2, __v)
}
};
{
val __v = weight
if (__v != 0.0f) {
_output__.writeFloat(3, __v)
}
};
{
val __v = maximumPaymentResults
if (__v != 0) {
_output__.writeUInt32(4, __v)
}
};
{
val __v = minimumFailureRelaxInterval
if (__v != 0L) {
_output__.writeUInt64(5, __v)
}
};
{
val __v = model.value
if (__v != 0) {
_output__.writeEnum(6, __v)
}
};
estimatorConfig.apriori.foreach { __v =>
val __m = __v
_output__.writeTag(7, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
estimatorConfig.bimodal.foreach { __v =>
val __m = __v
_output__.writeTag(8, 2)
_output__.writeUInt32NoTag(__m.serializedSize)
__m.writeTo(_output__)
};
unknownFields.writeTo(_output__)
}
def withHalfLifeSeconds(__v: _root_.scala.Long): MissionControlConfig = copy(halfLifeSeconds = __v)
def withHopProbability(__v: _root_.scala.Float): MissionControlConfig = copy(hopProbability = __v)
def withWeight(__v: _root_.scala.Float): MissionControlConfig = copy(weight = __v)
def withMaximumPaymentResults(__v: _root_.scala.Int): MissionControlConfig = copy(maximumPaymentResults = __v)
def withMinimumFailureRelaxInterval(__v: _root_.scala.Long): MissionControlConfig = copy(minimumFailureRelaxInterval = __v)
def withModel(__v: routerrpc.MissionControlConfig.ProbabilityModel): MissionControlConfig = copy(model = __v)
def getApriori: routerrpc.AprioriParameters = estimatorConfig.apriori.getOrElse(routerrpc.AprioriParameters.defaultInstance)
def withApriori(__v: routerrpc.AprioriParameters): MissionControlConfig = copy(estimatorConfig = routerrpc.MissionControlConfig.EstimatorConfig.Apriori(__v))
def getBimodal: routerrpc.BimodalParameters = estimatorConfig.bimodal.getOrElse(routerrpc.BimodalParameters.defaultInstance)
def withBimodal(__v: routerrpc.BimodalParameters): MissionControlConfig = copy(estimatorConfig = routerrpc.MissionControlConfig.EstimatorConfig.Bimodal(__v))
def clearEstimatorConfig: MissionControlConfig = copy(estimatorConfig = routerrpc.MissionControlConfig.EstimatorConfig.Empty)
def withEstimatorConfig(__v: routerrpc.MissionControlConfig.EstimatorConfig): MissionControlConfig = copy(estimatorConfig = __v)
def withUnknownFields(__v: _root_.scalapb.UnknownFieldSet) = copy(unknownFields = __v)
def discardUnknownFields = copy(unknownFields = _root_.scalapb.UnknownFieldSet.empty)
def getFieldByNumber(__fieldNumber: _root_.scala.Int): _root_.scala.Any = {
(__fieldNumber: @_root_.scala.unchecked) match {
case 1 => {
val __t = halfLifeSeconds
if (__t != 0L) __t else null
}
case 2 => {
val __t = hopProbability
if (__t != 0.0f) __t else null
}
case 3 => {
val __t = weight
if (__t != 0.0f) __t else null
}
case 4 => {
val __t = maximumPaymentResults
if (__t != 0) __t else null
}
case 5 => {
val __t = minimumFailureRelaxInterval
if (__t != 0L) __t else null
}
case 6 => {
val __t = model.javaValueDescriptor
if (__t.getNumber() != 0) __t else null
}
case 7 => estimatorConfig.apriori.orNull
case 8 => estimatorConfig.bimodal.orNull
}
}
def getField(__field: _root_.scalapb.descriptors.FieldDescriptor): _root_.scalapb.descriptors.PValue = {
_root_.scala.Predef.require(__field.containingMessage eq companion.scalaDescriptor)
(__field.number: @_root_.scala.unchecked) match {
case 1 => _root_.scalapb.descriptors.PLong(halfLifeSeconds)
case 2 => _root_.scalapb.descriptors.PFloat(hopProbability)
case 3 => _root_.scalapb.descriptors.PFloat(weight)
case 4 => _root_.scalapb.descriptors.PInt(maximumPaymentResults)
case 5 => _root_.scalapb.descriptors.PLong(minimumFailureRelaxInterval)
case 6 => _root_.scalapb.descriptors.PEnum(model.scalaValueDescriptor)
case 7 => estimatorConfig.apriori.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
case 8 => estimatorConfig.bimodal.map(_.toPMessage).getOrElse(_root_.scalapb.descriptors.PEmpty)
}
}
def toProtoString: _root_.scala.Predef.String = _root_.scalapb.TextFormat.printToUnicodeString(this)
def companion: routerrpc.MissionControlConfig.type = routerrpc.MissionControlConfig
// @@protoc_insertion_point(GeneratedMessage[routerrpc.MissionControlConfig])
}
object MissionControlConfig extends scalapb.GeneratedMessageCompanion[routerrpc.MissionControlConfig] {
implicit def messageCompanion: scalapb.GeneratedMessageCompanion[routerrpc.MissionControlConfig] = this
def parseFrom(`_input__`: _root_.com.google.protobuf.CodedInputStream): routerrpc.MissionControlConfig = {
var __halfLifeSeconds: _root_.scala.Long = 0L
var __hopProbability: _root_.scala.Float = 0.0f
var __weight: _root_.scala.Float = 0.0f
var __maximumPaymentResults: _root_.scala.Int = 0
var __minimumFailureRelaxInterval: _root_.scala.Long = 0L
var __model: routerrpc.MissionControlConfig.ProbabilityModel = routerrpc.MissionControlConfig.ProbabilityModel.APRIORI
var __estimatorConfig: routerrpc.MissionControlConfig.EstimatorConfig = routerrpc.MissionControlConfig.EstimatorConfig.Empty
var `_unknownFields__`: _root_.scalapb.UnknownFieldSet.Builder = null
var _done__ = false
while (!_done__) {
val _tag__ = _input__.readTag()
_tag__ match {
case 0 => _done__ = true
case 8 =>
__halfLifeSeconds = _input__.readUInt64()
case 21 =>
__hopProbability = _input__.readFloat()
case 29 =>
__weight = _input__.readFloat()
case 32 =>
__maximumPaymentResults = _input__.readUInt32()
case 40 =>
__minimumFailureRelaxInterval = _input__.readUInt64()
case 48 =>
__model = routerrpc.MissionControlConfig.ProbabilityModel.fromValue(_input__.readEnum())
case 58 =>
__estimatorConfig = routerrpc.MissionControlConfig.EstimatorConfig.Apriori(__estimatorConfig.apriori.fold(_root_.scalapb.LiteParser.readMessage[routerrpc.AprioriParameters](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case 66 =>
__estimatorConfig = routerrpc.MissionControlConfig.EstimatorConfig.Bimodal(__estimatorConfig.bimodal.fold(_root_.scalapb.LiteParser.readMessage[routerrpc.BimodalParameters](_input__))(_root_.scalapb.LiteParser.readMessage(_input__, _)))
case tag =>
if (_unknownFields__ == null) {
_unknownFields__ = new _root_.scalapb.UnknownFieldSet.Builder()
}
_unknownFields__.parseField(tag, _input__)
}
}
routerrpc.MissionControlConfig(
halfLifeSeconds = __halfLifeSeconds,
hopProbability = __hopProbability,
weight = __weight,
maximumPaymentResults = __maximumPaymentResults,
minimumFailureRelaxInterval = __minimumFailureRelaxInterval,
model = __model,
estimatorConfig = __estimatorConfig,
unknownFields = if (_unknownFields__ == null) _root_.scalapb.UnknownFieldSet.empty else _unknownFields__.result()
)
}
implicit def messageReads: _root_.scalapb.descriptors.Reads[routerrpc.MissionControlConfig] = _root_.scalapb.descriptors.Reads{
case _root_.scalapb.descriptors.PMessage(__fieldsMap) =>
_root_.scala.Predef.require(__fieldsMap.keys.forall(_.containingMessage eq scalaDescriptor), "FieldDescriptor does not match message type.")
routerrpc.MissionControlConfig(
halfLifeSeconds = __fieldsMap.get(scalaDescriptor.findFieldByNumber(1).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
hopProbability = __fieldsMap.get(scalaDescriptor.findFieldByNumber(2).get).map(_.as[_root_.scala.Float]).getOrElse(0.0f),
weight = __fieldsMap.get(scalaDescriptor.findFieldByNumber(3).get).map(_.as[_root_.scala.Float]).getOrElse(0.0f),
maximumPaymentResults = __fieldsMap.get(scalaDescriptor.findFieldByNumber(4).get).map(_.as[_root_.scala.Int]).getOrElse(0),
minimumFailureRelaxInterval = __fieldsMap.get(scalaDescriptor.findFieldByNumber(5).get).map(_.as[_root_.scala.Long]).getOrElse(0L),
model = routerrpc.MissionControlConfig.ProbabilityModel.fromValue(__fieldsMap.get(scalaDescriptor.findFieldByNumber(6).get).map(_.as[_root_.scalapb.descriptors.EnumValueDescriptor]).getOrElse(routerrpc.MissionControlConfig.ProbabilityModel.APRIORI.scalaValueDescriptor).number),
estimatorConfig = __fieldsMap.get(scalaDescriptor.findFieldByNumber(7).get).flatMap(_.as[_root_.scala.Option[routerrpc.AprioriParameters]]).map(routerrpc.MissionControlConfig.EstimatorConfig.Apriori(_))
.orElse[routerrpc.MissionControlConfig.EstimatorConfig](__fieldsMap.get(scalaDescriptor.findFieldByNumber(8).get).flatMap(_.as[_root_.scala.Option[routerrpc.BimodalParameters]]).map(routerrpc.MissionControlConfig.EstimatorConfig.Bimodal(_)))
.getOrElse(routerrpc.MissionControlConfig.EstimatorConfig.Empty)
)
case _ => throw new RuntimeException("Expected PMessage")
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.Descriptor = RouterProto.javaDescriptor.getMessageTypes().get(19)
def scalaDescriptor: _root_.scalapb.descriptors.Descriptor = RouterProto.scalaDescriptor.messages(19)
def messageCompanionForFieldNumber(__number: _root_.scala.Int): _root_.scalapb.GeneratedMessageCompanion[_] = {
var __out: _root_.scalapb.GeneratedMessageCompanion[_] = null
(__number: @_root_.scala.unchecked) match {
case 7 => __out = routerrpc.AprioriParameters
case 8 => __out = routerrpc.BimodalParameters
}
__out
}
lazy val nestedMessagesCompanions: Seq[_root_.scalapb.GeneratedMessageCompanion[_ <: _root_.scalapb.GeneratedMessage]] = Seq.empty
def enumCompanionForFieldNumber(__fieldNumber: _root_.scala.Int): _root_.scalapb.GeneratedEnumCompanion[_] = {
(__fieldNumber: @_root_.scala.unchecked) match {
case 6 => routerrpc.MissionControlConfig.ProbabilityModel
}
}
lazy val defaultInstance = routerrpc.MissionControlConfig(
halfLifeSeconds = 0L,
hopProbability = 0.0f,
weight = 0.0f,
maximumPaymentResults = 0,
minimumFailureRelaxInterval = 0L,
model = routerrpc.MissionControlConfig.ProbabilityModel.APRIORI,
estimatorConfig = routerrpc.MissionControlConfig.EstimatorConfig.Empty
)
sealed abstract class ProbabilityModel(val value: _root_.scala.Int) extends _root_.scalapb.GeneratedEnum {
type EnumType = ProbabilityModel
def isApriori: _root_.scala.Boolean = false
def isBimodal: _root_.scala.Boolean = false
def companion: _root_.scalapb.GeneratedEnumCompanion[ProbabilityModel] = routerrpc.MissionControlConfig.ProbabilityModel
final def asRecognized: _root_.scala.Option[routerrpc.MissionControlConfig.ProbabilityModel.Recognized] = if (isUnrecognized) _root_.scala.None else _root_.scala.Some(this.asInstanceOf[routerrpc.MissionControlConfig.ProbabilityModel.Recognized])
}
object ProbabilityModel extends _root_.scalapb.GeneratedEnumCompanion[ProbabilityModel] {
sealed trait Recognized extends ProbabilityModel
implicit def enumCompanion: _root_.scalapb.GeneratedEnumCompanion[ProbabilityModel] = this
@SerialVersionUID(0L)
case object APRIORI extends ProbabilityModel(0) with ProbabilityModel.Recognized {
val index = 0
val name = "APRIORI"
override def isApriori: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
case object BIMODAL extends ProbabilityModel(1) with ProbabilityModel.Recognized {
val index = 1
val name = "BIMODAL"
override def isBimodal: _root_.scala.Boolean = true
}
@SerialVersionUID(0L)
final case class Unrecognized(unrecognizedValue: _root_.scala.Int) extends ProbabilityModel(unrecognizedValue) with _root_.scalapb.UnrecognizedEnum
lazy val values = scala.collection.immutable.Seq(APRIORI, BIMODAL)
def fromValue(__value: _root_.scala.Int): ProbabilityModel = __value match {
case 0 => APRIORI
case 1 => BIMODAL
case __other => Unrecognized(__other)
}
def javaDescriptor: _root_.com.google.protobuf.Descriptors.EnumDescriptor = routerrpc.MissionControlConfig.javaDescriptor.getEnumTypes().get(0)
def scalaDescriptor: _root_.scalapb.descriptors.EnumDescriptor = routerrpc.MissionControlConfig.scalaDescriptor.enums(0)
}
sealed trait EstimatorConfig extends _root_.scalapb.GeneratedOneof {
def isEmpty: _root_.scala.Boolean = false
def isDefined: _root_.scala.Boolean = true
def isApriori: _root_.scala.Boolean = false
def isBimodal: _root_.scala.Boolean = false
def apriori: _root_.scala.Option[routerrpc.AprioriParameters] = _root_.scala.None
def bimodal: _root_.scala.Option[routerrpc.BimodalParameters] = _root_.scala.None
}
object EstimatorConfig {
@SerialVersionUID(0L)
case object Empty extends routerrpc.MissionControlConfig.EstimatorConfig {
type ValueType = _root_.scala.Nothing
override def isEmpty: _root_.scala.Boolean = true
override def isDefined: _root_.scala.Boolean = false
override def number: _root_.scala.Int = 0
override def value: _root_.scala.Nothing = throw new java.util.NoSuchElementException("Empty.value")
}
@SerialVersionUID(0L)
final case class Apriori(value: routerrpc.AprioriParameters) extends routerrpc.MissionControlConfig.EstimatorConfig {
type ValueType = routerrpc.AprioriParameters
override def isApriori: _root_.scala.Boolean = true
override def apriori: _root_.scala.Option[routerrpc.AprioriParameters] = Some(value)
override def number: _root_.scala.Int = 7
}
@SerialVersionUID(0L)
final case class Bimodal(value: routerrpc.BimodalParameters) extends routerrpc.MissionControlConfig.EstimatorConfig {
type ValueType = routerrpc.BimodalParameters
override def isBimodal: _root_.scala.Boolean = true
override def bimodal: _root_.scala.Option[routerrpc.BimodalParameters] = Some(value)
override def number: _root_.scala.Int = 8
}
}
implicit class MissionControlConfigLens[UpperPB](_l: _root_.scalapb.lenses.Lens[UpperPB, routerrpc.MissionControlConfig]) extends _root_.scalapb.lenses.ObjectLens[UpperPB, routerrpc.MissionControlConfig](_l) {
def halfLifeSeconds: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.halfLifeSeconds)((c_, f_) => c_.copy(halfLifeSeconds = f_))
def hopProbability: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Float] = field(_.hopProbability)((c_, f_) => c_.copy(hopProbability = f_))
def weight: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Float] = field(_.weight)((c_, f_) => c_.copy(weight = f_))
def maximumPaymentResults: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Int] = field(_.maximumPaymentResults)((c_, f_) => c_.copy(maximumPaymentResults = f_))
def minimumFailureRelaxInterval: _root_.scalapb.lenses.Lens[UpperPB, _root_.scala.Long] = field(_.minimumFailureRelaxInterval)((c_, f_) => c_.copy(minimumFailureRelaxInterval = f_))
def model: _root_.scalapb.lenses.Lens[UpperPB, routerrpc.MissionControlConfig.ProbabilityModel] = field(_.model)((c_, f_) => c_.copy(model = f_))
def apriori: _root_.scalapb.lenses.Lens[UpperPB, routerrpc.AprioriParameters] = field(_.getApriori)((c_, f_) => c_.copy(estimatorConfig = routerrpc.MissionControlConfig.EstimatorConfig.Apriori(f_)))
def bimodal: _root_.scalapb.lenses.Lens[UpperPB, routerrpc.BimodalParameters] = field(_.getBimodal)((c_, f_) => c_.copy(estimatorConfig = routerrpc.MissionControlConfig.EstimatorConfig.Bimodal(f_)))
def estimatorConfig: _root_.scalapb.lenses.Lens[UpperPB, routerrpc.MissionControlConfig.EstimatorConfig] = field(_.estimatorConfig)((c_, f_) => c_.copy(estimatorConfig = f_))
}
final val HALF_LIFE_SECONDS_FIELD_NUMBER = 1
final val HOP_PROBABILITY_FIELD_NUMBER = 2
final val WEIGHT_FIELD_NUMBER = 3
final val MAXIMUM_PAYMENT_RESULTS_FIELD_NUMBER = 4
final val MINIMUM_FAILURE_RELAX_INTERVAL_FIELD_NUMBER = 5
final val MODEL_FIELD_NUMBER = 6
final val APRIORI_FIELD_NUMBER = 7
final val BIMODAL_FIELD_NUMBER = 8
def of(
halfLifeSeconds: _root_.scala.Long,
hopProbability: _root_.scala.Float,
weight: _root_.scala.Float,
maximumPaymentResults: _root_.scala.Int,
minimumFailureRelaxInterval: _root_.scala.Long,
model: routerrpc.MissionControlConfig.ProbabilityModel,
estimatorConfig: routerrpc.MissionControlConfig.EstimatorConfig
): _root_.routerrpc.MissionControlConfig = _root_.routerrpc.MissionControlConfig(
halfLifeSeconds,
hopProbability,
weight,
maximumPaymentResults,
minimumFailureRelaxInterval,
model,
estimatorConfig
)
// @@protoc_insertion_point(GeneratedMessageCompanion[routerrpc.MissionControlConfig])
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy