Advertisement
Guest User

Untitled

a guest
Nov 24th, 2014
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. public abstract class MyAbstractAgent extends Agent
  2. implements java.io.Serializable {
  3.  
  4. private static final long serialVersionUID = 1L;
  5.  
  6. /**
  7. * Constructor in form required for an Agent subclass to be instantiated and for
  8. * superclass instantiation (as gleaned from looking at Java source of
  9. * visually-created Agents)
  10. */
  11. public MyAbstractAgent(Engine engine,
  12. Agent owner,
  13. AgentList<? extends MyAbstractAgent> collection) {
  14.  
  15. super (engine, owner, collection);
  16.  
  17. }
  18.  
  19. /*
  20. * Simple constructor as now included in all AnyLogic 7 generated Agent code. Don't
  21. * understand when this would be invoked cf. the others so let's assert that we
  22. * don't think it should
  23. */
  24. public MyAbstractAgent() {
  25.  
  26. throw new AssertionError("Not expecting simple constructor to be used!");
  27.  
  28. }
  29.  
  30. // Using package visibility (the default for GUI-designed functions)
  31. abstract specialAbstractFunction();
  32.  
  33. }
  34.  
  35. throw new IllegalStateException("Subclass must implement specialAbstractMethod()");
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement