public override void executa(IOrganismo o) { int inst = o.getMemory(o.ip + 1); inst = mundo.getMutation().mutateInstruction(inst, o); int regVal = o.getReg(getByteOrganismo(o, 2)); o.setMemory(regVal, inst); }
private void randomizeInstruction(IOrganismo o) { int memPos = CRJavaUtils.randomInt(-10, 10); int index = o.ip() + memPos; int inst = o.getMemory(index); inst = changeInstruction(inst); o.setMemory(index, inst); }
public override void executa(IOrganismo o) { int fromPos = o.getReg(getByteOrganismo(o, 2)); int inst = o.getMemory(fromPos); inst = mundo.getMutation().mutateInstruction(inst, o); /*if (!mundo.isValidInstruction(inst)){ * o.fatalError(); * return; * }*/ o.setReg(getByteOrganismo(o, 1), inst); }
private void randomizeInstruction(IOrganismo o) { int memPos = Utils.RandomInt(-10, 10); int index = o.ip + memPos; if (index < o.sp()) { index = o.sp(); } int inst = o.getMemory(index); inst = changeInstruction(inst); o.setMemory(index, inst); }
public override String getDescription(IOrganismo o, int ip) { return(comment(name + " " + ALifeConsts.getLetter(o.getMemory(ip + 1)), ALifeConsts.getLetter(o.getMemory(ip + 1)) + " <- pop()")); }
public override String getDescription(IOrganismo o, int ip) { return(comment(name + " " + ALifeConsts.getLetter(o.getMemory(ip + 1)) + "," + ALifeConsts.getLetter(o.getMemory(ip + 2)), "Allocate " + ALifeConsts.getLetter(o.getMemory(ip + 1)) + " Bytes; store position in " + ALifeConsts.getLetter(o.getMemory(ip + 2)))); }
public override String getDescription(IOrganismo o, int ip) { return(comment(name + " " + ALifeConsts.getLetter(o.getMemory(ip + 1)) + "," + ALifeConsts.getLetter(o.getMemory(ip + 2)), "if " + ALifeConsts.getLetter(o.getMemory(ip + 1)) + " < " + ALifeConsts.getLetter(o.getMemory(ip + 2)) + " then:")); }
protected int getByteOrganismo(IOrganismo o, int pos) { int inst = o.getMemory(o.ip + pos); return(inst); }
public override String getDescription(IOrganismo o, int ip) { return(comment(name + " " + ALifeConsts.getLetter(o.getMemory(ip + 1)), "push(ip); ip <- " + o.getMemory(ip + 1) + ";")); }
public override String getDescription(IOrganismo o, int ip) { return(comment(name + " " + o.getMemory(ip + 1), "ip <- " + o.getMemory(ip + 1))); }
public override String getDescription(IOrganismo o, int ip) { return(comment(name + " " + ALifeConsts.getLetter(o.getMemory(ip + 1)), ALifeConsts.getLetter(o.getMemory(ip + 1)) + " <- templatePosition" + (this.bwd ? " BACK " : "") + (this.fwd ? " FWD " : ""))); }