Path

This module contains the definition of the Path class.

Example

Creating a Path:

from core.entity.properties import ExpressionProperty
from core.mathematics.values import Value
path = Path(from_model, to_model, Value(1), 'path name')
class gsf.models.core.path.Path(from_model: BaseModel, to_model: BaseModel, weight: ExpressionProperty, name: str = None, entity_manager: EntityManager = None)

Bases: gsf.core.entity.core.entity.Entity

Connection between models.

Parameters
  • from_model (BaseModel) – Source model of the path.

  • to_model (BaseModel) – Destination model of the path.

  • weight (ExpressionProperty) – Weight of the connection.

  • name (str) – Name of the path.

  • entity_manager (EntityManager) – Manager of entities in the system.

_serial_id

Serial of the path

Type

int

_from

Source model of the path.

Type

BaseModel

_to

Destination model of the path.

Type

BaseModel

_weight

Weight of the connection.

Type

ExpressionProperty

get_destination_model()BaseModel

Returns the destination model

get_properties()Dict[str, gsf.core.entity.core.entity_property.EntityProperty]

Lists the properties of the entity.

Returns

{ ‘Weight’: ExpressionProperty }

get_source_model()BaseModel

Returns the source model

Returns

BaseModel: The origin model of the path.

get_weight()float

Return the evaluation of the weight.

set_weight(weight: gsf.core.entity.properties.expression_property.ExpressionProperty)

Sets the weight of the path

Parameters

weight (ExpressionProperty) – Weight of the path.