bobocep.cep.phenom.pattern.builder.BoboPatternBuilder

class bobocep.cep.phenom.pattern.builder.BoboPatternBuilder(name: str)[source]

Bases: object

A pattern builder.

__init__(name: str)[source]
Parameters

name – Pattern name.

followed_by(predicate: Union[bobocep.cep.phenom.pattern.predicate.BoboPredicate, Callable], group: str = '', times: int = 1, loop: bool = False, optional: bool = False) BoboPatternBuilder[source]

Adds a block with relaxed contiguity.

Parameters
  • predicate – Block predicate. If a Callable is provided, it will be wrapped in a BoboPredicateCall instance.

  • group – Block group.

  • times – Number of times to add this block to the pattern, in sequence.

  • loop – If True, the block loops back onto itself.

  • optional – If True, the block is optional.

Returns

The BoboPatternBuilder instance that made the function call.

followed_by_any(predicates: List[Union[bobocep.cep.phenom.pattern.predicate.BoboPredicate, Callable]], group: str = '', times: int = 1, loop: bool = False, optional: bool = False) BoboPatternBuilder[source]

Adds multiple blocks with non-deterministic relaxed contiguity.

Parameters
  • predicates – Predicates, one per block. Any Callable types in the list will be wrapped in their own BoboPredicateCall instance.

  • group – Group name for all blocks.

  • times – Number of times to add these blocks to the pattern, in sequence.

  • loop – If True, the blocks loop back onto themselves.

  • optional – If True, the blocks are optional.

Returns

The BoboPatternBuilder instance that made the function call.

generate() bobocep.cep.phenom.pattern.pattern.BoboPattern[source]

Generates a BoboPattern instance with the configuration specified in the builder.

Returns

A BoboPattern instance.

haltcondition(predicate: Union[bobocep.cep.phenom.pattern.predicate.BoboPredicate, Callable]) BoboPatternBuilder[source]

Adds a haltcondition.

Parameters

predicate – The haltcondition predicate. If a Callable is provided, it will be wrapped in a BoboPredicateCall instance.

Returns

The BoboPatternBuilder instance that made the function call.

next(predicate: Union[bobocep.cep.phenom.pattern.predicate.BoboPredicate, Callable], group: str = '', times: int = 1, loop: bool = False) BoboPatternBuilder[source]

Adds a block with strict contiguity.

Parameters
  • predicate – Block predicate. If a Callable is provided, it will be wrapped in a BoboPredicateCall instance.

  • group – Block group.

  • times – Number of times to add this block to the pattern, in sequence.

  • loop – If True, the block loops back onto itself (making it non-deterministic). If False, the block remains deterministic.

Returns

The BoboPatternBuilder instance that made the function call.

not_followed_by(predicate: Union[bobocep.cep.phenom.pattern.predicate.BoboPredicate, Callable], group: str = '', times: int = 1) BoboPatternBuilder[source]

Adds a negated block with relaxed contiguity.

Parameters
  • predicate – Block predicate. If a Callable is provided, it will be wrapped in a BoboPredicateCall instance.

  • group – Block group.

  • times – Number of times to add this block to the pattern, in sequence.

Returns

The BoboPatternBuilder instance that made the function call.

not_followed_by_any(predicates: List[Union[bobocep.cep.phenom.pattern.predicate.BoboPredicate, Callable]], group: str = '', times: int = 1) BoboPatternBuilder[source]

Adds multiple negated blocks with non-deterministic relaxed contiguity.

Parameters
  • predicates – Predicates, one per block. Any Callable types in the list will be wrapped in their own BoboPredicateCall instance.

  • group – Group name for all blocks.

  • times – Number of times to add these blocks to the pattern, in sequence.

Returns

The BoboPatternBuilder instance that made the function call.

not_next(predicate: Union[bobocep.cep.phenom.pattern.predicate.BoboPredicate, Callable], group: str = '', times: int = 1) BoboPatternBuilder[source]

Adds a negated block with strict contiguity.

Parameters
  • predicate – Block predicate. If a Callable is provided, it will be wrapped in a BoboPredicateCall instance.

  • group – Block group.

  • times – Number of times to add this block to the pattern, in sequence.

Returns

The BoboPatternBuilder instance that made the function call.

precondition(predicate: Union[bobocep.cep.phenom.pattern.predicate.BoboPredicate, Callable]) BoboPatternBuilder[source]

Adds a precondition.

Parameters

predicate – The precondition predicate. If a Callable is provided, it will be wrapped in a BoboPredicateCall instance.

Returns

The BoboPatternBuilder instance that made the function call.