Last active
December 31, 2016 03:36
-
-
Save swapnilshrikhande/290c7a8dd0326f5a04e517672cc4c7c6 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public interface Organism { | |
} | |
public interface Part { | |
List<Limb> | |
} | |
public interface Limb { | |
//can be composed of Cells | |
List<Cell> cells; | |
} | |
public Interface Cell { | |
private Map<String,Object> state; | |
private Map<String,EventReaction> eventResponses; | |
public Cell(){ | |
state = new Map<String,Object>(); | |
} | |
public Cell(Map<String,Object> stateP){ | |
this.state = stateP; | |
} | |
public Integer remember(String key,Object value) | |
//teach cell how to | |
public Integer learn(String event,EventReaction reaction); | |
//triggers/calls a event which will help cell react in a particular way | |
public Map<String,Object> call(String event); | |
public Cell reproduce(Cell papa); | |
public List<Cell> reproduceMany(Cell papa,Integer count); | |
} | |
public Interface EventReaction { | |
public Map<String,Object> react(Map<String,Object> state); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment