Update of /cvsroot/javanetsim/javaNetSim/core
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4295/core
Modified Files:
Link.java Simulation.java
Log Message:
Index: Simulation.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/Simulation.java,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Simulation.java 19 Nov 2005 14:26:02 -0000 1.3
--- Simulation.java 19 Nov 2005 16:55:37 -0000 1.4
***************
*** 500,503 ****
--- 500,537 ----
}
+ /**
+ * Get link probability.
+ * @author Key
+ * @param inLinkName - The name of the link eg: Link1
+ * @throws InvalidLinkNameException
+ * @version v0.20
+ **/
+ public double GetLinkProb(String inLinkName) throws InvalidLinkNameException{
+ if(linkTable.containsKey(inLinkName)){
+ Link lnk = (Link)linkTable.get(inLinkName);
+ return lnk.getSC();
+ }else{
+ throw new InvalidLinkNameException("Link does not exist");
+ }
+
+ }
+
+ /**
+ * Get link probability.
+ * @author Key
+ * @param inLinkName - The name of the link eg: Link1
+ * @param SC - sieve coefficient: *TODO* - description
+ * @throws InvalidLinkNameException
+ * @version v0.20
+ **/
+ public void SetLinkProb(String inLinkName, double SC) throws InvalidLinkNameException{
+ if(linkTable.containsKey(inLinkName)){
+ ((Link)linkTable.get(inLinkName)).setSC(SC);
+ }else{
+ throw new InvalidLinkNameException("Link does not exist");
+ }
+
+ }
+
/**
* This method checks to see if inLinkName is contained within the has table(linkTable).If so,
Index: Link.java
===================================================================
RCS file: /cvsroot/javanetsim/javaNetSim/core/Link.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -C2 -d -r1.1 -r1.2
*** Link.java 8 Nov 2005 15:35:29 -0000 1.1
--- Link.java 19 Nov 2005 16:55:37 -0000 1.2
***************
*** 63,67 ****
--- 63,85 ----
/** Name of the link */
protected String name;
+
+ protected double sievingCoefficient;
+
+ /** *TODO*: javaDoc
+ *
+ */
+ public double getSC(){
+ return sievingCoefficient;
+ }
+
+
+ /** *TODO*: javaDoc
+ *
+ */
+ public void setSC(double SC){
+ sievingCoefficient = SC;
+ }
+
/**
* Constructs a Link with the specified name. Conceptually this will simply create a cable
***************
*** 75,78 ****
--- 93,97 ----
NetworkInterfaces = new Vector();
name = inName;
+ sievingCoefficient = 100;
}
|