Description Details Slots Creating objects of type Node Methods Derived Classes To be used for Note Author(s) See Also Examples
This class is part of the HNUORTools. It represents the base class for every locateable class in an Operations-Research (OR)-context.
Find here the defined slots for this class.
id: Object of class
"character", containing data from id.
Should be unique. The default value will be
caluclated randomly.
label: Object of
class "character", containing the label of the
Node. The default value will be caluclated
randomly.
x: Object of class
"numeric", containing the x-coordinate of the
Node. The default value will be caluclated
randomly.
y: Object of class
"numeric", containing the y-coordinate of the
Node. The default value will be caluclated
randomly.
NodeS4-Objectnew("Node", ...)
data.frameas.Node{<data.frame>} See also
below in the Methods-Section.
listas.Node{<list>} See also below in
the Methods-Section.
as.list(node, ...) Converts a
Node into a list. ...
are user-defined (not used) parameters.
as.data.frame(node, ...) Converts a
Node into a data.frame.
as.data.frame accepts the optional parameter
withrownames of class "logical" (default is
TRUE). If withrownames == TRUE the
returned data.frame will recieve the
id as rowname. ... are user-defined (not
used) parameters.
as.Node(obj) Converts an object of class
data.frame or of class list
into a Node.
is.Node(obj)Checks if the object obj is of type
Node.
getDistanceCalculating the distance between two Nodes
(As the classes Customer and
Warehouse depend on Node,
distances can be calculated between any of these
objects).
getpolar Calculating
the polar-angle to the x-Axis of a link, connecting two
Nodes (As the classes
Customer and Warehouse depend
on Node, polar-angles can be calculated
between any of these objects).
Customer This class
extends the Node-Class with attributes for
according to customers for OR-Problems.
Warehouse This class extends the
Node-Class with attributes for according to
warehouses for OR-Problems.
LinkThis class is constructed by two entities of the
Node-Class representing the origin and
destination of Link for OR-Problems.
Shortest-Path-Problem
Travelling Salesman Problem
for citing use: Felix Lindemann (2014). HNUORTools: Operations Research Tools. R package version 1.1-0. http://felixlindemann.github.io/HNUORTools/.
Dipl. Kfm. Felix Lindemann felix.lindemann@hs-neu-ulm.de
Wissenschaftlicher Mitarbeiter Kompetenzzentrum Logistik Buro ZWEI, 17
Hochschule fur angewandte Wissenschaften Fachhochschule Neu-Ulm | Neu-Ulm University Wileystr. 1
D-89231 Neu-Ulm
Phone +49(0)731-9762-1437 Web www.hs-neu-ulm.de/felix-lindemann/ http://felixlindemann.blogspot.de
The classes are derived from this class and the following Methods can be used with this class.:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | # create a new Node with specific values
x<- new("Node", x= 10, y=20, id="myid", label = "mylabel")
x
# create from data.frame
df<- data.frame(x=10,y=20)
new("Node", df)
as(df, "Node")
as.Node(df)
#create some nodes
n1 <- new("Node",x=10,y=20, id ="n1")
n2 <- new("Node",x=13,y=24, id ="n1")
# calculate Beeline distance
#getDistance(n1,n2) # should result 5
#getDistance(n1,n2, costs = 2) # should result 10
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.