PathContext
for graphs with WeightedLink
a_star $ WeightedPathContext :: SELF
Type of this instance, automatically specialized in every classa_star $ WeightedPathContext :: core_serialize_to
Actual serialization ofself
to serializer
a_star $ WeightedPathContext :: from_deserializer
Create an instance of this class from thedeserializer
a_star $ WeightedPathContext :: worst_cost
Worst cost of all the link's costsa_star $ WeightedPathContext :: worst_heuristic_cost
The worst cost suggested by the heuristicserialization :: Serializable :: accept_json_serializer
Refinable service to customize the serialization of this class to JSONserialization :: Serializable :: accept_msgpack_attribute_counter
Hook to customize the behavior of theAttributeCounter
serialization :: Serializable :: accept_msgpack_serializer
Hook to customize the serialization of this class to MessagePackserialization :: Serializable :: add_to_bundle
Called by[]=
to dynamically choose the appropriate method according
core :: Object :: class_factory
Implementation used byget_class
to create the specific class.
serialization :: Serializable :: core_serialize_to
Actual serialization ofself
to serializer
core :: Object :: defaultinit
a_star :: PathContext :: defaultinit
serialization :: Serializable :: from_deserializer
Create an instance of this class from thedeserializer
core :: Object :: is_same_instance
Return true ifself
and other
are the same instance (i.e. same identity).
core :: Object :: is_same_serialized
Isself
the same as other
in a serialization context?
core :: Object :: is_same_type
Return true ifself
and other
have the same dynamic type.
serialization :: Serializable :: msgpack_extra_array_items
Hook to request a larger than usual metadata arraycore :: Object :: output_class_name
Display class name on stdout (debug only).serialization :: Serializable :: serialize_msgpack
Serializeself
to MessagePack bytes
serialization :: Serializable :: serialize_to
Serializeself
to serializer
serialization :: Serializable :: serialize_to_json
Serializeself
to JSON
serialization :: Serializable :: to_pretty_json
Serializeself
to plain pretty JSON
a_star :: PathContext :: worst_heuristic_cost
The worst cost suggested by the heuristicSerializer::serialize
# A `PathContext` for graphs with `WeightedLink`
class WeightedPathContext
super PathContext
serialize
redef type L: WeightedLink
init
do
super
var worst_cost = 0
for l in graph.links do
var cost = l.weight
if cost >= worst_cost then worst_cost = cost + 1
end
self.worst_cost = worst_cost
end
redef var worst_cost is noinit
redef fun cost(l) do
return l.weight
end
redef fun is_blocked(l) do return false
redef fun heuristic_cost(a, b) do return 0
redef fun worst_heuristic_cost do return 0
end
lib/a_star/a_star.nit:376,1--403,3