Creates a copy of an agent. The copy is shallow in the sense that the new Agent shares the same attributes as the original Agent.
@param a an {@link Agent} to copy
@return a copy of the input {@link Agent}
171153
public Agent newAgent(Agent a) {
	Agent res = newAgent(a.getId());
	res.getType().addAll(a.getType());
	res.getLabel().addAll(a.getLabel());
	return res;
    }
1263391
function copy(out, a) {
  out[0] = a[0];
  out[1] = a[1];
  out[2] = a[2];
  out[3] = a[3];
  out[4] = a[4];
  out[5] = a[5];
  out[6] = a[6];
  out[7] = a[7];
  out[8] = a[8];
  return out;
}
1079415
public FeatureState copy() {
        FeatureState copy = new FeatureState(feature);
        copy.setEnabled(this.enabled);
        copy.setStrategyId(this.strategyId);
        for (Entry<String, String> entry : this.parameters.entrySet()) {
            copy.setParameter(entry.getKey(), entry.getValue());
        }
        return copy;
    }
222535
public static <T> T[] copyOfRange(final T[] original, int from, final int to, final int step, final Class<? extends T[]> newType) {
        N.checkFromToIndex(from < to ? from : (to == -1 ? 0 : to), from < to ? to : from, original.length);

        if (step == 0) {
            throw new IllegalArgumentException("The input parameter 'by' can not be zero");
        }

        if (from == to || from < to != step > 0) {
            return Object[].class.equals(newType) ? (T[]) new Object[0] : (T[]) N.newArray(newType.getComponentType(), 0);
        }

        if (step == 1) {
            return copyOfRange(original, from, to);
        }

        from = from > to ? N.min(original.length - 1, from) : from;
        final int len = (to - from) / step + ((to - from) % step == 0 ? 0 : 1);
        final T[] copy = Object[].class.equals(newType) ? (T[]) new Object[len] : (T[]) N.newArray(newType.getComponentType(), len);

        for (int i = 0, j = from; i < len; i++, j += step) {
            copy[i] = original[j];
        }

        return copy;
    }
10967
@Override
	public T copy(T from) {
		if (CONCURRENT_ACCESS_CHECK) {
			enterExclusiveThread();
		}

		try {
			checkAvroInitialized();
			return avroData.deepCopy(runtimeSchema, from);
		}
		finally {
			if (CONCURRENT_ACCESS_CHECK) {
				exitExclusiveThread();
			}
		}
	}
647092
@Override
    public boolean simpleEvaluation(Agent currentAgent) {
        Agent agent = currentAgent;
        if (bodyId != null) {
            agent = agent.getAgentsAppState().getAgent(bodyId);
            if(agent == null) {
                logger.log(Level.SEVERE, "Body {0} does not exists!", new Object[]{bodyId});
                return false;
            }
        }
        if(agent instanceof HumanAgent) {
            return ((HumanAgent)agent).getBodyPosture().name().equals(bodyState);
        }
        return false;
    }
461326
@XmlElementDecl(namespace = PROV_NS, name = "agent")
    public JAXBElement<Agent> createAgent(Agent value) {
        return new JAXBElement<Agent>(_Agent_QNAME, Agent.class, null, value);
    }
1109891
@Override
    public Rankable copy() {
        List<Object> shallowCopyOfFields = ImmutableList.copyOf(getFields());
        return new RankableObjectWithFields(getObject(), getCount(), shallowCopyOfFields);
    }
820907
private static IAction createAction(String action) {
        IAction actn = null;
        
        if (!StringUtils.isEmpty(action)) {
            if ((actn = ActionRegistry.getRegisteredAction(action)) == null) {
                actn = ActionUtil.createAction(null, action);
            }
        }
        
        return actn;
    }
1035117
public static Object copy(Object thing) throws CopyNotSupportedException {
    if (!isCopyable(thing)) {
      throw new CopyNotSupportedException(thing.getClass().getName() + " cannot be copied. See Copyable");
    }
    if (thing instanceof Copyable) {
      return ((Copyable) thing).copy();
    }
    // Support for a few primitive types out of the box
    if (thing instanceof byte[]) {
      byte[] copy = new byte[((byte[]) thing).length];
      System.arraycopy(thing, 0, copy, 0, ((byte[]) thing).length);
      return copy;
    }

    // Assume that everything other type is immutable, not checking this again
    return thing;
  }
346360
@Override
	public <T> Component getAgent(String id) {

		if (agentComponents.containsKey(id)) {
			return agentComponents.get(id);
		}
		return createAgent(id);
	}
890540
public static Automaton getDeepestAutomaton(Agent agent) {
        Automaton a1 = agent.getAutomaton();
        Automaton a2 = agent.getAutomaton().currentState;
        while (a2 != null || !(a2 instanceof SimpleState)) {
            a1 = a2;
            a2 = a2.currentState;

        }
        return a1;

    }
729651
public static byte[] copyOf(byte[] byteArray) {

    	byte[] copy = new byte[byteArray.length];
        System.arraycopy(byteArray, 0, copy, 0, byteArray.length);
        return copy;
    }
1274547
public PropertyDescriptorImpl shallowCopy() {
    final ConstraintDescriptorImpl<?>[] desc = new ConstraintDescriptorImpl<?>[descriptors.size()];
    descriptors.toArray(desc);
    return new PropertyDescriptorImpl( //
        name, //
        elementClass, //
        cascaded, //
        parentBeanMetadata, //
        validationGroupsMetadata, //
        desc);
  }
483252
public Object copy(final Object obj, final PersistenceBroker broker)
    {
        return clone(obj, IdentityMapFactory.getIdentityMap(), broker);
    }
32350
function copyOnto(a1, a2) {
  if (Array.isArray(a1) && Array.isArray(a2)) return copyOntoArray (a1, a2);
  if (isObject     (a1) && isObject     (a2)) return copyOntoObject(a1, a2);
  return (a1 = a2);
}
7800
public <T extends BioPAXElement> T copy(T source, String newID) 
	{
		T copy = (T) level.getDefaultFactory().create(
				(Class<T>) source.getModelInterface(), newID);
		this.copy = copy;
		// to avoid unnecessary checks/warnings when existing valid element is being cloned  
		//(e.g., copying BPS.stepProcess values, if there is a Conversion, which was set via stepConversion).
		AbstractPropertyEditor.checkRestrictions.set(false);
		traverser.traverse(source, null);
		AbstractPropertyEditor.checkRestrictions.set(true);//back to default
		return copy;
	}