|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
How Can I visualize a Network Projection? And how would I go about implementing the EdgeCreator Interface?Hello,
I'm new to Repast, and over the last couple of days I've been analyzing the sample codes as well as reading the documentation, trying to understand it. I would like to simulate a computer network using Repast, to simulate certain behaviors in it. I think the Network Projection would let me connect the agents the way I need. However, I can't see the topology when I run my simulation. What I did was to take the simplehappy source in the examples. I've implemented a similar context, but only with the network projection. Then I added 2 agents I created that wouldn't do anything, besides being there and connecting to each other. The problem is, the agents aren't being drawn in the simulation. Do I need a grid or something similar even if I'm not interested in the specific positions the agents are? Also, I read in the documentation that to customize the way the connections are made between the nodes, I'd have to implement the EdgeCreator interface. But I'm not sure how the edges between nodes are currently formed. For example, what would be the variables? What is stored once an edge is made between 2 nodes? Where is it stored? etc. I think an example of implementation for this interface would clear things a bit. Thanks. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Repast-interest mailing list Repast-interest@... https://lists.sourceforge.net/lists/listinfo/repast-interest |
|
|
Re: How Can I visualize a Network Projection? And how would I go about implementing the EdgeCreator Interface?Did you add the agents to the context? I'm assuming you've created a display.
On the EdgeCreator, created edges are stored in the Network projection. You can get reference to the Network via the Context that it "projects". The EdgeCreator itself is for creating edge classes that extend RepastEdge. You'd use if you need edge properties in addition to what repast provides. It assumes that you've written an edge class that provides those properties and you then write an EdgeCreator that creates edges of that type. Once you've associated the EdgeCreator with the projection via something like: NetworkBuilder builder = new NetworkBuilder("Network", context, true); builder.setEdgeCreator(myEdgeCreator); Any edges that you get from the Network or that are created via Network.addEdge() are created with the EdgeCreator and all the edges in the network will be of that type.As for implementation, its not much, here's extremely simple example:where TestEdge is an empty subclass of RepastEdge. public class TestEdge extends RepastEdge { public TestEdge(Object source, Object target, boolean directed) { super(source, target, directed); } public TestEdge(Object source, Object target, boolean directed, double weight) { super(source, target, directed, weight); } } You'd obviously want to create your own edge class that actually did something. Nick On Nov 4, 2009, at 12:17 PM, fdsf dfds wrote: Hello, ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Repast-interest mailing list Repast-interest@... https://lists.sourceforge.net/lists/listinfo/repast-interest |
|
|
Re: How Can I visualize a Network Projection? And how would I go about implementing the EdgeCreator Interface?I added the agents to the context, but as far as creating a display goes, I'm not sure.
When I'm in the simulation window, there is the scenario tree. I right click display to add a new one, but I can't progress any further because my classes aren't selectable to be added to the display. Looking at the sample codes, there are some XML files that seem to describe these displays. Is that what you mean by creating one? Is there a tutorial on what can be done and how in them? ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Repast-interest mailing list Repast-interest@... https://lists.sourceforge.net/lists/listinfo/repast-interest |
|
|
|
|
|
Re: How Can I visualize a Network Projection? And how would I go about implementing the EdgeCreator Interface?You might want to go through the tutorial. Not necessarily do it, but giving it a read may help in understanding how to set up a simulation and the various files (*.xml) and folders (*.rs). As for the topology, take a look at NetworkBuilder in
Nick On Nov 7, 2009, at 7:00 PM, fdsf dfds wrote: I had already added them to the score and set up the .class path correctly. ------------------------------------------------------------------------------ Let Crystal Reports handle the reporting - Free Crystal Reports 2008 30-Day trial. Simplify your report design, integration and deployment - and focus on what you do best, core application coding. Discover what's new with Crystal Reports now. http://p.sf.net/sfu/bobj-july _______________________________________________ Repast-interest mailing list Repast-interest@... https://lists.sourceforge.net/lists/listinfo/repast-interest |
| Free embeddable forum powered by Nabble | Forum Help |