blob: 2efe3be92f827097a8cefd15050bab5c65330105 [file] [log] [blame]
package org.metaabm.gen.test;
/**
* State 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 StateAgent {
/**
*
*/
private PrimaryColorEnum primaryColor = PrimaryColorEnum.red;
/**
* Constructs a new State Agent.
*/
public StateAgent() {
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 {
StateAgent clone = (StateAgent) 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 testSetStateToYellow() {
/*PROTECTED REGION ID(StateAgent_testSetStateToYellow_Pre) ENABLED START*/
//Pre-Conditions Here
/*PROTECTED REGION END*/
setPrimaryColor(PrimaryColorEnum.yellow);
/*PROTECTED REGION ID(StateAgent_testSetStateToYellow_Post) ENABLED START*/
//Post-Conditions Here
/*PROTECTED REGION END*/
}
/**
* Gets the Primary Color property for State Agent.
* @return
*/
@repast.simphony.parameter.Parameter(displayName = "Primary Color", usageName = "primaryColor", defaultValue = "red")
public PrimaryColorEnum getPrimaryColor() {
return primaryColor;
}
/**
* Sets the Primary Color property for State Agent.
*
* @param _primaryColor the new Primary Color value
*/
public void setPrimaryColor(PrimaryColorEnum _primaryColor) {
primaryColor = _primaryColor;
}
}