Class MultiplexerData
- java.lang.Object
-
- ec.gp.GPData
-
- ec.app.multiplexer.MultiplexerData
-
public class MultiplexerData extends GPData
This is ugly and complicated because it needs to hold a variety of different-length bitstrings, including temporary ones held while computing subtrees.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field and Description long[]dat_11An array of 32 longs for Multiplexer-11 databytedat_3A byte for Multiplexer-3 datalongdat_6A long for Multiplexer-6 datastatic intMULTI_11_BITLENGTHThe length of an atomic data element in Multiplexer-11 (a long)static intMULTI_11_NUM_BITSTRINGSThe number of atomic elements in Multiplexer-11 comprising one string (32)static intMULTI_3_BITLENGTHThe length of an atomic data element in Multiplexer-3 (a byte)static intMULTI_6_BITLENGTHThe length of an atomic data element in Multiplexer-6 (a long)bytestatusA byte indicating the number of Dn in this problemstatic byteSTATUS_11The number of Dn in Multiplexer-11static byteSTATUS_3The number of Dn in Multiplexer-3static byteSTATUS_6The number of Dn in Multiplexer-6java.util.StacktmpA stack of available long arrays for popDat11/pushDat11
-
Constructor Summary
Constructors Constructor and Description MultiplexerData()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description java.lang.Objectclone()Creates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.voidcopyTo(GPData gpd)Modifies gpd so that gpd is equivalent to us.long[]popDat11()Pops a dat_11 off of the stack; if the stack is empty, creates a new dat_11 and returns that.voidpushDat11(long[] l)Pushes a dat_11 onto the stack-
Methods inherited from class ec.gp.GPData
defaultBase, setup
-
-
-
-
Field Detail
-
tmp
public java.util.Stack tmp
A stack of available long arrays for popDat11/pushDat11
-
STATUS_3
public static final byte STATUS_3
The number of Dn in Multiplexer-3- See Also:
- Constant Field Values
-
STATUS_6
public static final byte STATUS_6
The number of Dn in Multiplexer-6- See Also:
- Constant Field Values
-
STATUS_11
public static final byte STATUS_11
The number of Dn in Multiplexer-11- See Also:
- Constant Field Values
-
MULTI_3_BITLENGTH
public static final int MULTI_3_BITLENGTH
The length of an atomic data element in Multiplexer-3 (a byte)- See Also:
- Constant Field Values
-
MULTI_6_BITLENGTH
public static final int MULTI_6_BITLENGTH
The length of an atomic data element in Multiplexer-6 (a long)- See Also:
- Constant Field Values
-
MULTI_11_BITLENGTH
public static final int MULTI_11_BITLENGTH
The length of an atomic data element in Multiplexer-11 (a long)- See Also:
- Constant Field Values
-
MULTI_11_NUM_BITSTRINGS
public static final int MULTI_11_NUM_BITSTRINGS
The number of atomic elements in Multiplexer-11 comprising one string (32)- See Also:
- Constant Field Values
-
dat_11
public long[] dat_11
An array of 32 longs for Multiplexer-11 data
-
dat_6
public long dat_6
A long for Multiplexer-6 data
-
dat_3
public byte dat_3
A byte for Multiplexer-3 data
-
status
public byte status
A byte indicating the number of Dn in this problem
-
-
Method Detail
-
popDat11
public long[] popDat11()
Pops a dat_11 off of the stack; if the stack is empty, creates a new dat_11 and returns that.
-
pushDat11
public void pushDat11(long[] l)
Pushes a dat_11 onto the stack
-
clone
public java.lang.Object clone()
Description copied from interface:PrototypeCreates a new individual cloned from a prototype, and suitable to begin use in its own evolutionary context.Typically this should be a full "deep" clone. However, you may share certain elements with other objects rather than clone hem, depending on the situation:
- If you hold objects which are shared with other instances, don't clone them.
- If you hold objects which must be unique, clone them.
- If you hold objects which were given to you as a gesture of kindness, and aren't owned by you, you probably shouldn't clone them.
- DON'T attempt to clone: Singletons, Cliques, or Groups.
- Arrays are not cloned automatically; you may need to clone an array if you're not sharing it with other instances. Arrays have the nice feature of being copyable by calling clone() on them.
Implementations.
- If no ancestor of yours implements clone(), and you have no need to do clone deeply, and you are abstract, then you should not declare clone().
- If no ancestor of yours implements clone(),
and you have no need to do clone deeply,
and you are not abstract, then you should implement
it as follows:
public Object clone() { try { return super.clone(); } catch ((CloneNotSupportedException e) { throw new InternalError(); } // never happens } - If no ancestor of yours implements clone(), but you
need to deep-clone some things, then you should implement it
as follows:
public Object clone() { try { MyObject myobj = (MyObject) (super.clone()); // put your deep-cloning code here... } catch ((CloneNotSupportedException e) { throw new InternalError(); } // never happens return myobj; } - If an ancestor has implemented clone(), and you also need
to deep clone some things, then you should implement it as follows:
public Object clone() { MyObject myobj = (MyObject) (super.clone()); // put your deep-cloning code here... return myobj; }
-
copyTo
public void copyTo(GPData gpd)
Description copied from class:GPDataModifies gpd so that gpd is equivalent to us. You may safely assume that gpd is of the same class as we are. Do not share pointers with the other object, except to read-only data: instead, copy any read-write data as necessary.
-
-
DMelt 3.0 © DataMelt by jWork.ORG