/*
 * JaamSim Discrete Event Simulation
 * Copyright (C) 2018-2019 JaamSim Software Inc.
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package com.jaamsim.SubModels;

import com.jaamsim.Graphics.DisplayEntity;
import com.jaamsim.ProcessFlow.Linkable;

public class SubModelStart extends DisplayEntity implements Linkable {

	public SubModelStart() {}

	@Override
	public void addEntity(DisplayEntity ent) {
		// TODO Auto-generated method stub
	}

}

@@ -687,277 +687,1997 @@
 ort 
-com.jaamsim.Graphics.DisplayEntity;%0Aimport com.jaamsim.ProcessFlow.Linkable;%0A%0Apublic class SubModelStart extends DisplayEntity implements Linkable %7B%0A%0A%09public SubModelStart() %7B%7D%0A%0A%09@Override%0A%09public void addEntity(DisplayEntity ent) %7B%0A%09%09// TODO Auto-generated method stub
+java.util.ArrayList;%0A%0Aimport com.jaamsim.Commands.KeywordCommand;%0Aimport com.jaamsim.Graphics.DisplayEntity;%0Aimport com.jaamsim.Graphics.LinkDisplayable;%0Aimport com.jaamsim.ProcessFlow.EntityGenerator;%0Aimport com.jaamsim.ProcessFlow.Linkable;%0Aimport com.jaamsim.basicsim.Entity;%0Aimport com.jaamsim.input.InputAgent;%0Aimport com.jaamsim.input.InterfaceEntityInput;%0Aimport com.jaamsim.input.Keyword;%0Aimport com.jaamsim.input.KeywordIndex;%0Aimport com.jaamsim.math.Vec3d;%0A%0Apublic class SubModelStart extends DisplayEntity implements Linkable, LinkDisplayable %7B%0A%0A%09@Keyword(description = %22The next component in the sub-model.%22,%0A%09%09%09exampleList = %7B%22Queue1%22%7D)%0A%09protected final InterfaceEntityInput%3CLinkable%3E nextComponent;%0A%09%7B%0A%09%09nextComponent = new InterfaceEntityInput%3C%3E(Linkable.class, %22NextComponent%22, KEY_INPUTS, null);%0A%09%09nextComponent.setRequired(true);%0A%09%09this.addInput(nextComponent);%0A%09%7D%0A%0A%09public SubModelStart() %7B%7D%0A%0A%09@Override%0A%09public void addEntity(DisplayEntity ent) %7B%0A%09%09nextComponent.getValue().addEntity(ent);%0A%09%7D%0A%0A%09@Override%0A%09public void linkTo(DisplayEntity nextEnt) %7B%0A%09%09if (nextComponent.getHidden() %7C%7C !(nextEnt instanceof Linkable)%0A%09%09%09%09%7C%7C nextEnt instanceof EntityGenerator) %7B%0A%09%09%09return;%0A%09%09%7D%0A%0A%09%09ArrayList%3CString%3E toks = new ArrayList%3C%3E();%0A%09%09toks.add(nextEnt.getName());%0A%09%09KeywordIndex kw = new KeywordIndex(nextComponent.getKeyword(), toks, null);%0A%09%09InputAgent.storeAndExecute(new KeywordCommand(this, kw));%0A%09%7D%0A%0A%09// LinkDisplayable%0A%09@Override%0A%09public ArrayList%3CEntity%3E getDestinationEntities() %7B%0A%09%09ArrayList%3CEntity%3E ret = new ArrayList%3C%3E();%0A%09%09Linkable l = nextComponent.getValue();%0A%09%09if (l != null && (l instanceof Entity)) %7B%0A%09%09%09ret.add((Entity)l);%0A%09%09%7D%0A%09%09return ret;%0A%09%7D%0A%0A%09@Override%0A%09public ArrayList%3CEntity%3E getSourceEntities() %7B%0A%09%09return new ArrayList%3C%3E();%0A%09%7D%0A%0A%09@Override%0A%09public Vec3d getSourcePoint() %7B%0A%09%09return getGlobalPosition();%0A%09%7D%0A%09@Override%0A%09public Vec3d getSinkPoint() %7B%0A%09%09return getGlobalPosition();%0A%09%7D%0A%0A%09@Override%0A%09public double getRadius() %7B%0A%09%09return getSize().mag2()/2.0;
 %0A%09%7D%0A

add code for 'SubModelStart' to SubModels