using System;
using System.Collections.Generic;
using System.Text;
namespace Sunweaver.VM
{
public class VirtualMachine
{
public VirtualMachine(Memory memory) : this(null, memory)
{
}
public VirtualMachine(Chromosome chromosome, Memory memory)
{
Memory = memory;
CallingChromosome = chromosome;
}
public VirtualMachine() : this(null, new Memory())
{
}
///
/// A stack of integers used for DNA manipulations. We use 64 bit integers
/// so we can minimize issues of overflow.
///
public IntStack Stack = new IntStack();
///
/// A stack of booleans used for conditions
///
public BoolStack BoolStack = new BoolStack();
///
/// A temporary memory array that acts like a robots array
///
public Memory Memory;
///
/// Codule callstack.
///
public Stack CallStack = new Stack(new int[] { 0 });
///
/// Any codule calls will call in to the calling chromosome.
///
public Chromosome CallingChromosome;
///
/// How many base pairs have been executed against this Virtual Machine.
///
public ulong ExecutedBP = 0;
///
/// Controls wether DNA is executed or bypassed. Toggled in DNA with start/stop
///
public bool Executing = true;
}
}