This repository has been archived by the owner on Oct 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 81
Added vertex property inspectors. #107
Open
deinst
wants to merge
15
commits into
JuliaAttic:master
Choose a base branch
from
deinst:fix_a_star
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 4 commits
Commits
Show all changes
15 commits
Select commit
Hold shift + click to select a range
ef73302
Added vertex property inspectors.
deinst 9f41e05
Fixed typing of heuristic inspector
deinst 7a3dd16
Fixed cut/paste induced grammar error
deinst 5304455
interim checkin
deinst 8c0e900
dont need to reexport setindex and getindex
deinst 9821140
interim cleanup
deinst 7091ea2
Merge branch 'hash_a_star' into fix_a_star
deinst 298e9a1
Fixed mysterious typo that occurred on merge.
deinst 91f69aa
backed out colormap changes
deinst 8074764
kinda fixed doco
deinst 0025cad
Made the code less 'convent'ional (removed 'none')
deinst 52900f3
Extracted the non general property extractors from the library, put …
deinst 2056bc2
removed non general inspectors from common.jl
deinst 1175ff0
Merge branch 'master' into fix_a_star
deinst 42af312
brought documentation up to date
deinst File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -101,6 +101,50 @@ Both edge types implement the following methods: | |
|
||
A custom edge type ``E{V}`` which is constructible by ``E(index::Int, s::V, t::V)`` and implements the above methods is usable in the ``VectorIncidenceList`` parametric type. Construct such a list with ``inclist(V,E{V})``, where E and V are your vertex and edge types. See test/inclist.jl for an example. | ||
|
||
Vertex Properties | ||
--------------- | ||
|
||
Many algorithms use a property of a vertex such as amount of a | ||
resource provided or required by that vertex as input. As the | ||
algorithms do not mandate any structure for the vertex types, these | ||
vertex properties can be passed through to the algorithm by an | ||
``VertexPropertyInspector``. An ``VertexPropertyInspector`` when | ||
passed to the ``vertex_property`` method along with a vertex and a | ||
graph, will return that property of a vertex. | ||
|
||
All vertex property inspectors should be declared as a subtype of | ||
``AbstractVertexPropertyInspector{T}`` where ``T`` is the type of the | ||
vertex property. The vertex propery inspector should respond to the | ||
following methods. | ||
|
||
.. py::function:: vertex_property(i, e, g) | ||
|
||
returns the vertex property of vertex ``v`` in graph ``g`` selected by | ||
inspector ``i``. | ||
|
||
.. py::function:: vertex_property_requirement(i, g) | ||
|
||
checks that graph ``g`` implements the interface(s) necessary for | ||
inspector ``i`` | ||
|
||
Three vertex property inspectors are provided | ||
``ConstantVertexPropertyInspector``, ``VectorVertexPropertyInspector`` and | ||
``AttributeVertexPropertyInspector``. | ||
|
||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. And |
||
``ConstantVertexPropertyInspector(c)`` constructs a vertex property | ||
inspector that returns the constant ``c`` for each vertex. | ||
|
||
``VectorVertexPropertyInspector(vec)`` constructs a vertex property | ||
inspector that returns ``vec[vertex_index(v, g)]``. It requires that | ||
``g`` implement the ``vertex_map`` interface. | ||
|
||
``FunctionVertexPropertyInspector(func)`` constructs a vertex property | ||
inspector that returns the result of ``func(v)`` from an ``ExVertex``. | ||
``AttributeVertexPropertyInspector`` requires that the graph implements | ||
the ``vertex_map`` interface. | ||
|
||
|
||
|
||
Edge Properties | ||
--------------- | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"An" on these two lines should also be "a".