class HIERARCHIC_GRAPH_NODE [E -> HASHABLE]

All features

Direct parents

conformant parents

HASHABLE

non-conformant parents

ANY, PLATFORM

Known children

conformant children

LOADED_HIERARCHIC_GRAPH_NODE

Summary

creation features

exported features

Maximum:

Minimum:

Bits:

Details

make (i: E)

ensure

  • parents_count = 0
  • children_count = 0
  • item = i

make (i: E)

ensure

  • parents_count = 0
  • children_count = 0
  • item = i

item: E
max_rank: INTEGER
min_rank: INTEGER
parents: FAST_ARRAY[HIERARCHIC_GRAPH_NODE [E -> HASHABLE]]
children: FAST_ARRAY[HIERARCHIC_GRAPH_NODE [E -> HASHABLE]]
set_item (i: E)
parents_count: INTEGER
children_count: INTEGER
add_parent (node: HIERARCHIC_GRAPH_NODE [E -> HASHABLE])

require

  • node /= Void

add_child (node: HIERARCHIC_GRAPH_NODE [E -> HASHABLE])

require

  • node /= Void

remove_parent (node: HIERARCHIC_GRAPH_NODE [E -> HASHABLE])

require

  • has_parent(node)

has_parent_edge (id: INTEGER): BOOLEAN
has_child_edge (id: INTEGER): BOOLEAN
remove_child (node: HIERARCHIC_GRAPH_NODE [E -> HASHABLE])

require

  • has_child(node)

remove_parent_edge (id: INTEGER): HIERARCHIC_GRAPH_NODE [E -> HASHABLE]

Return connected node.

require

  • has_parent_edge(id)

ensure

  • not has_parent_edge(id)

restore_parent_edge (id: INTEGER, node: HIERARCHIC_GRAPH_NODE [E -> HASHABLE])

require

  • not has_parent_edge(id)
  • has_parent_edge(-1)
  • has_parent(node)
  • not node.has_child_edge(id)
  • node.has_child_edge(-1)

ensure

  • has_parent_edge(id)

remove_child_edge (id: INTEGER): HIERARCHIC_GRAPH_NODE [E -> HASHABLE]

Return connected node.

require

  • has_child_edge(id)

ensure

  • not has_child_edge(id)

restore_child_edge (id: INTEGER, node: HIERARCHIC_GRAPH_NODE [E -> HASHABLE])

require

  • not has_child_edge(id)
  • has_child_edge(-1)
  • has_child(node)
  • not node.has_parent_edge(id)
  • node.has_parent_edge(-1)

ensure

  • has_child_edge(id)

deep_reset_edges

Set edge identifiers with values starting from 0.

parent (i: INTEGER): HIERARCHIC_GRAPH_NODE [E -> HASHABLE]

require

  • i.in_range(1, parents_count)

child (i: INTEGER): HIERARCHIC_GRAPH_NODE [E -> HASHABLE]

require

  • i.in_range(1, children_count)

has_parent (other: HIERARCHIC_GRAPH_NODE [E -> HASHABLE]): BOOLEAN

ensure

  • Result = other.has_child(Current)

has_child (other: HIERARCHIC_GRAPH_NODE [E -> HASHABLE]): BOOLEAN

ensure

  • Result = other.has_parent(Current)

parent_edge (i: INTEGER): INTEGER

require

  • i.in_range(1, parents_count)

child_edge (i: INTEGER): INTEGER

require

  • i.in_range(1, children_count)

has_cycle: BOOLEAN
has_parent_cycle: BOOLEAN
has_children_cycle: BOOLEAN
is_toplevel: BOOLEAN

ensure

  • Result = (parents_count = 0)

is_leaf: BOOLEAN

ensure

  • Result = (children_count = 0)

is_connected_to (other: HIERARCHIC_GRAPH_NODE [E -> HASHABLE]): BOOLEAN

require

  • other /= Void

ensure

  • Result = (distance(other) /= Maximum_integer)

distance (other: HIERARCHIC_GRAPH_NODE [E -> HASHABLE]): INTEGER

require

  • other /= Void

ensure

  • is_connected_to(other) = (distance(other) /= Maximum_integer)

set_rank

require

  • not has_cycle

    TODO: no graph cycle

add_connected_nodes_in (list: COLLECTION[HIERARCHIC_GRAPH_NODE[E]])

Add in list all nodes belonging to the same graph as Current

require

  • list /= Void

fill_path_to (path: COLLECTION [E_][INTEGER], destination: HIERARCHIC_GRAPH_NODE [E -> HASHABLE])

Add in path edges identifiers corresponding to a path from current node to destination node.

require

  • is_connected_to(destination)
  • destination /= Current

hash_code: INTEGER

The hash-code value of Current.

ensure

  • good_hash_value: Result >= 0

internal_has_parent_cycle: BOOLEAN
internal_has_children_cycle: BOOLEAN
internal_is_connected_to (other: HIERARCHIC_GRAPH_NODE [E -> HASHABLE]): BOOLEAN

require

  • other /= Void

internal_unmark_parents
internal_unmark_children
internal_unmark_connected

unmark parents and children

internal_deep_reset_edges: INTEGER
internal_deep_init_edges (use: INTEGER): INTEGER
internal_distance (other: HIERARCHIC_GRAPH_NODE [E -> HASHABLE], pos: INTEGER, max: INTEGER): INTEGER

Returns Maximum_integer if unaccessibility detected Returns -1 when break needed Distance from current point otherwise Warning: max length and pos are from the search start.

require

  • max >= pos
  • max < Maximum_integer

ensure

    clean_mark_score
    internal_set_rank
    internal_add_connected_nodes_in (list: COLLECTION[HIERARCHIC_GRAPH_NODE[E]])
    internal_fill_path_to (path: COLLECTION [E_][INTEGER], destination: HIERARCHIC_GRAPH_NODE [E -> HASHABLE], position: INTEGER): BOOLEAN
    invariant_checking_mode: REFERENCE [E_][BOOLEAN]
    valid_parents: BOOLEAN
    valid_children: BOOLEAN
    valid_parents_and_children: BOOLEAN

    ensure

    • assertion_only: Result

    set_invariant_checking_mode (new_mode: BOOLEAN)

    require

    • new_mode /= invariant_checking_mode.item

    deconnect_current
    parents_edge: FAST_ARRAY [E_][INTEGER]
    children_edge: FAST_ARRAY [E_][INTEGER]
    mark: BOOLEAN
    unmark
    set_mark
    deep_unmark_connected

    deep unmark parents and children (paths stops at unmarked nodes)

    mark_score: INTEGER
    deferred is_equal (other: HIERARCHIC_GRAPH_NODE [E -> HASHABLE]): BOOLEAN

    Is other attached to an object considered equal to current object ?

    require

    • other /= Void

    ensure

    • Result implies hash_code = other.hash_code
    • commutative: generating_type = other.generating_type implies Result = other.is_equal(Current)

    Maximum_character_code: INTEGER_16

    Largest supported code for CHARACTER values.

    ensure

    • meaningful: Result >= 127

    Maximum_integer_8: INTEGER_8

    Largest supported value of type INTEGER_8.

    Maximum_integer_16: INTEGER_16

    Largest supported value of type INTEGER_16.

    Maximum_integer: INTEGER

    Largest supported value of type INTEGER/INTEGER_32.

    Maximum_integer_32: INTEGER

    Largest supported value of type INTEGER/INTEGER_32.

    Maximum_integer_64: INTEGER_64

    Largest supported value of type INTEGER_64.

    Maximum_real_32: REAL_32

    Largest non-special (no NaNs nor infinity) supported value of type REAL_32.

    Maximum_real: REAL

    Largest non-special (no NaNs nor infinity) supported value of type REAL. Just to give an idea of this value: 1.79769313486231570....e+308

    Maximum_real_64: REAL

    Largest non-special (no NaNs nor infinity) supported value of type REAL. Just to give an idea of this value: 1.79769313486231570....e+308

    Maximum_real_80: REAL_EXTENDED

    Largest supported value of type REAL_80.

    ensure

    • meaningful: Result >= Maximum_real

    Minimum_character_code: INTEGER_16

    Smallest supported code for CHARACTER values.

    ensure

    • meaningful: Result <= 0

    Minimum_integer_8: INTEGER_8

    Smallest supported value of type INTEGER_8.

    Minimum_integer_16: INTEGER_16

    Smallest supported value of type INTEGER_16.

    Minimum_integer: INTEGER

    Smallest supported value of type INTEGER/INTEGER_32.

    Minimum_integer_32: INTEGER

    Smallest supported value of type INTEGER/INTEGER_32.

    Minimum_integer_64: INTEGER_64

    Smallest supported value of type INTEGER_64.

    Minimum_real_32: REAL_32

    Smallest non-special (no NaNs nor infinity) supported value of type REAL_32.

    Minimum_real: REAL

    Smallest non-special (no NaNs nor infinity) supported value of type REAL. Just to give an idea of this value: -1.79769313486231570....e+308

    Minimum_real_64: REAL

    Smallest non-special (no NaNs nor infinity) supported value of type REAL. Just to give an idea of this value: -1.79769313486231570....e+308

    Minimum_real_80: REAL

    Smallest supported value of type REAL_80.

    ensure

    • meaningful: Result <= 0.0

    Boolean_bits: INTEGER

    Number of bits in a value of type BOOLEAN.

    ensure

    • meaningful: Result >= 1

    Character_bits: INTEGER

    Number of bits in a value of type CHARACTER.

    ensure

    • meaningful: Result >= 1
    • large_enough: 2.to_integer ^ Result >= Maximum_character_code

    Integer_bits: INTEGER

    Number of bits in a value of type INTEGER.

    ensure

    • integer_definition: Result = 32

    Real_bits: INTEGER

    Number of bits in a value of type REAL.

    Pointer_bits: INTEGER

    Number of bits in a value of type POINTER.

    Class invariant