001    /**
002     * planningtool - A Planning Tool with Critiquing Support.
003     * 
004     * Copyright (C) 2006 olale
005    
006     * This program is free software; you can redistribute it and/or
007     * modify it under the terms of the GNU General Public License
008     * as published by the Free Software Foundation; either version 2
009     * of the License, or (at your option) any later version.
010    
011     * This program is distributed in the hope that it will be useful,
012     * but WITHOUT ANY WARRANTY; without even the implied warranty of
013     * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
014     * GNU General Public License for more details.
015    
016     * You should have received a copy of the GNU General Public License
017     * along with this program; if not, write to the Free Software
018     * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
019    
020     * Contact information: 
021     * E-mail: olale@ida.liu.se
022     *         olale@lysator.liu.se
023     */
024    package se.liu.ida.critiquer.scenarios.standard;
025    
026    import java.util.HashMap;
027    
028    import se.liu.ida.critiquer.resources.Agent;
029    import se.liu.ida.critiquer.resources.Suitability;
030    
031    public class PoliceUnit extends Agent {
032    
033            
034            /**
035             * 
036             */
037            private static final long serialVersionUID = 1L;
038    
039    
040    
041            public PoliceUnit(String name) {
042                    super(name);
043                    init();
044            }
045    
046            
047            /**
048             * @param parent
049             * @param name
050             */
051            public PoliceUnit(Agent parent, String name) {
052                    super(parent, name);
053                    init();
054            }
055    
056    
057    
058            private void init() {
059                    // We need only model which tasks an agent is unfit to perform
060                    HashMap<Class, Suitability> suitabilityMap = new HashMap<Class, Suitability>();
061                    suitabilityMap.put(FirstAidActivity.class,Suitability.UNFIT);
062                    suitabilityMap.put(RecoverActivity.class,Suitability.UNFIT);
063                    Agent.fitnessMap.put(this.getClass(), suitabilityMap);
064    
065                    StandardAgentParameterFactory.createFuelParameters(this,90,11);
066    
067                    StandardAgentParameterFactory.createSpeedParameter(this, 140L);
068                    
069                    StandardAgentParameterFactory.createTransportParameter(this,3);
070                    
071                    StandardAgentParameterFactory.createRoadBlockTimeParameter(this,15L);           
072                    
073                    initPanel();
074            }
075    
076    
077    
078    
079    
080            
081    
082            
083            
084    }