Class AllocationPlan
- java.lang.Object
-
- jmri.jmrit.dispatcher.AllocationPlan
-
public class AllocationPlan extends java.lang.Object
Handle planning information for AutoAllocateAn Allocation Plan involves a planned meet of two ActiveTrains in a specified area of the layout.
AllocationPlan objects are transient (not saved between runs).
AllocationPlan objects are created and disposed by AutoAllocate as needed. AutoAllocate serves as the manager of AllocationPlan objects.
An ActiveTrain may be in more than one AllocationPlan of the same type, provided its target Section in all active AllocationPlans is the same.
An AllocationPlan is "complete" when both Active Trains have been allocated their target Sections.
This file is part of JMRI.
JMRI is open source software; you can redistribute it and/or modify it under the terms of version 2 of the GNU General Public License as published by the Free Software Foundation. See the "COPYING" file for a copy of this license.
JMRI is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
-
-
Field Summary
Fields Modifier and Type Field Description protected static int
CONTINUING
protected static int
NONE
Constants representing the type of AllocationPlanprotected static int
PASSING_MEET
protected static int
XING_MEET
-
Constructor Summary
Constructors Constructor Description AllocationPlan(AutoAllocate aa, int planNum)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
dispose()
protected ActiveTrain
getActiveTrain(int i)
protected int
getPlanNum()
protected int
getPlanType()
protected Section
getTargetSection(int i)
protected int
getTargetSectionSequenceNum(int i)
protected boolean
isComplete()
protected void
setActiveTrain(ActiveTrain at, int i)
protected void
setPlanType(int type)
protected void
setTargetSection(Section s, int seq, int i)
-
-
-
Field Detail
-
NONE
protected static final int NONE
Constants representing the type of AllocationPlan- See Also:
- Constant Field Values
-
XING_MEET
protected static final int XING_MEET
- See Also:
- Constant Field Values
-
PASSING_MEET
protected static final int PASSING_MEET
- See Also:
- Constant Field Values
-
CONTINUING
protected static final int CONTINUING
- See Also:
- Constant Field Values
-
-
Constructor Detail
-
AllocationPlan
public AllocationPlan(AutoAllocate aa, int planNum)
-
-
Method Detail
-
getPlanNum
protected int getPlanNum()
-
getPlanType
protected int getPlanType()
-
setPlanType
protected void setPlanType(int type)
-
getActiveTrain
protected ActiveTrain getActiveTrain(int i)
-
setActiveTrain
protected void setActiveTrain(ActiveTrain at, int i)
-
getTargetSection
protected Section getTargetSection(int i)
-
setTargetSection
protected void setTargetSection(Section s, int seq, int i)
-
getTargetSectionSequenceNum
protected int getTargetSectionSequenceNum(int i)
-
isComplete
protected boolean isComplete()
-
dispose
public void dispose()
-
-