RepastHPC  2.3.1
RelogoLink.h
1 /*
2  * Repast for High Performance Computing (Repast HPC)
3  *
4  * Copyright (c) 2010 Argonne National Laboratory
5  * All rights reserved.
6  *
7  * Redistribution and use in source and binary forms, with
8  * or without modification, are permitted provided that the following
9  * conditions are met:
10  *
11  * Redistributions of source code must retain the above copyright notice,
12  * this list of conditions and the following disclaimer.
13  *
14  * Redistributions in binary form must reproduce the above copyright notice,
15  * this list of conditions and the following disclaimer in the documentation
16  * and/or other materials provided with the distribution.
17  *
18  * Neither the name of the Argonne National Laboratory nor the names of its
19  * contributors may be used to endorse or promote products derived from
20  * this software without specific prior written permission.
21  *
22  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
23  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
24  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
25  * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE TRUSTEES OR
26  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
27  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
28  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
29  * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
30  * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
31  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
32  * EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33  *
34  *
35  * RelogoLink.h
36  *
37  * Created on: Aug 5, 2010
38  * Author: nick
39  */
40 
41 #ifndef RELOGOEDGE_H_
42 #define RELOGOEDGE_H_
43 
44 
45 
46 #include "repast_hpc/Edge.h"
47 #include "repast_hpc/AgentId.h"
48 
49 #include "RelogoAgent.h"
50 
51 
52 namespace repast {
53 namespace relogo {
54 
58 class RelogoLink: public repast::RepastEdge<RelogoAgent> {
59 
60 public:
66  }
67 
76 
86 
94  RelogoLink(boost::shared_ptr<RelogoAgent> source, boost::shared_ptr<RelogoAgent> target);
95 
104  RelogoLink(boost::shared_ptr<RelogoAgent> source, boost::shared_ptr<RelogoAgent> target, double weight);
105 
109  RelogoLink(const RelogoLink& edge);
110 
111  virtual ~RelogoLink();
112 };
113 
114 
118 class RelogoLinkContent: public RepastEdgeContent<RelogoAgent>{
119 public:
122 
123 };
124 
125 
131 
132 public:
134  virtual ~RelogoLinkContentManager(){}
135 
136  RelogoLink* createEdge(RelogoLinkContent& content, repast::Context<RelogoAgent>* context){
137  return new RelogoLink(context->getAgent(content.source), context->getAgent(content.target), content.weight);
138  }
139 
140  RelogoLinkContent* provideEdgeContent(RelogoLink* edge){
141  return new RelogoLinkContent(edge);
142  }
143 
144 };
145 
146 }
147 
148 }
149 
150 #endif /* RELOGOEDGE_H_ */
repast::Context
Collection of agents of type T with set semantics.
Definition: Context.h:82
repast::relogo::RelogoAgent
Base agent for Relogo.
Definition: RelogoAgent.h:60
repast::RepastEdge< RelogoAgent >::target
RelogoAgent * target() const
Gets the target of this RepastEdge.
Definition: Edge.h:140
repast::Context::getAgent
T * getAgent(const AgentId &id)
Gets the specified agent.
Definition: Context.h:861
repast::RepastEdge< RelogoAgent >::weight
double weight() const
Gets the weight of this RepastEdge.
Definition: Edge.h:159
repast::RepastEdge< RelogoAgent >::source
RelogoAgent * source() const
Gets the source of this RepastEdge.
Definition: Edge.h:131
repast::RepastEdgeContent
Serializable; also, does not include agent content, only agent IDs.
Definition: Edge.h:219
repast::RepastEdge
Default graph / network edge implementation.
Definition: Edge.h:58