blob: cb7cb20730a717aa020eec38fc07ab64c880d8fa [file] [log] [blame]
package org.metaabm.gen.test;
/**
* Methods Agent Java Implementation.
*
* Generated by metaabm system: May 13, 2009 11:53:53 AM PDT in project: org.metaabm.gen.repast.test (testing) */
import static org.junit.Assert.*;
public class MethodsAgent {
/**
*
*/
private int integer1 = 1;
/**
* Constructs a new Methods Agent.
*/
public MethodsAgent() {
createUniqueID();
}
//todo, make this a useful value for evaluating compatibility of different versions of generated classes
private static final long serialVersionUID = 89989998L;
private String uniqueID;
public String getUID() {
return uniqueID;
}
public void createUniqueID() {
uniqueID = org.apache.commons.lang.RandomStringUtils
.randomAlphanumeric(5);
}
/**
* Clones the agent, ensuring that a unique id is assigned.
*/
public Object clone() {
try {
MethodsAgent clone = (MethodsAgent) super.clone();
clone.createUniqueID();
return clone;
} catch (Exception e) {
throw new RuntimeException("Unexpected cloning exception: " + e);
}
}
@org.junit.Test
public void dummy() {
assertTrue(true);
}
/**
*
*/
private BasicModel basicModelList = null;
/**
* Gets the Basic Model property for .
* @return
*/
public BasicModel getBasicModel() {
return basicModelList;
}
/**
* Sets the Basic Model property for .
*
* @param _basicModel the new Basic Model value
*/
public void setBasicModel(BasicModel _basicModel) {
basicModelList = _basicModel;
}
public double randomInRange(double minValue, double maxValue) {
return repast.simphony.random.RandomHelper.nextDoubleFromTo(minValue,
maxValue);
}
public double randomToLimit(double maxValue) {
return repast.simphony.random.RandomHelper.nextDoubleFromTo(0.0,
maxValue);
}
public int randomToLimit(int maxValue) {
return repast.simphony.random.RandomHelper.nextIntFromTo(0, maxValue);
}
/**
* .
*/
@org.junit.Test
@repast.simphony.engine.schedule.ScheduledMethod(start = 1, interval = 1, priority = -0)
public void testMethodsAgentRule() {
/*PROTECTED REGION ID(MethodsAgent_testMethodsAgentRule_Pre) ENABLED START*/
//Pre-Conditions Here
/*PROTECTED REGION END*/
setInteger1(getInteger1() + 1);
/*PROTECTED REGION ID(MethodsAgent_testMethodsAgentRule_Post) ENABLED START*/
//Post-Conditions Here
/*PROTECTED REGION END*/
}
/**
* .
*/
@org.junit.Test
public void methodAddsOnetoInteger1() {
setInteger1(getInteger1() + 1);
}
/**
* Gets the Integer 1 property for Methods Agent.
* @return
*/
@repast.simphony.parameter.Parameter(displayName = "Integer 1", usageName = "integer1", defaultValue = "1")
public int getInteger1() {
return integer1;
}
/**
* Sets the Integer 1 property for Methods Agent.
*
* @param _integer1 the new Integer 1 value
*/
public void setInteger1(int _integer1) {
integer1 = _integer1;
}
}