org.gscg.common.interactionlayer.timecontrol
Class GlobalRowOrColumnNumber

java.lang.Object
  extended byorg.gscg.common.interactionlayer.timecontrol.GlobalRowOrColumnNumber
All Implemented Interfaces:
java.io.Serializable

public class GlobalRowOrColumnNumber
extends java.lang.Object
implements java.io.Serializable

The RowOrColumnNumber calculates the row or column which should be selected according to the time in the simulation. Implementing row or column control in this way makes sure that not every actor in a game is going to perform this expensive code every time for itself, instead we use a 'global' approach, and thus increase our performance.

Copyright (c) 2003-2005 Delft University of Technology, Jaffalaan 5, 2628 BX Delft, the Netherlands. All rights reserved. See for project information www.simulation.tudelft.nl . The source code and binary code of this software is proprietary information of Delft University of Technology.

Since:
1.1.1
Version:
$Revision: 1.2 $ $Date: 2005/08/09 20:49:45 $
Author:
Stijn-Pieter van Houten
See Also:
Serialized Form

Nested Class Summary
static class GlobalRowOrColumnNumber.CustomEventProducer
          A custom implementation of an event producer.
 
Field Summary
static nl.tudelft.simulation.event.EventType TOTAL_NUMBER_OF_DAYS
          fired to indicate the total number of days in the simulation
static nl.tudelft.simulation.event.EventType UPDATE_CURRENT_DATE
          fired when the date in the game has changed
static nl.tudelft.simulation.event.EventType UPDATE_CURRENT_DATES
          fired when the all the columns and rows must be updated according to the simulation time
static nl.tudelft.simulation.event.EventType UPDATE_CURRENT_DAY
          fired when the current row or column must be updated according to the simulation time
static nl.tudelft.simulation.event.EventType UPDATE_CURRENT_MONTH
          fired when the current row or column must be updated according to the simulation time
static nl.tudelft.simulation.event.EventType UPDATE_CURRENT_WEEK
          fired when the current row or column must be updated according to the simulation time
 
Constructor Summary
GlobalRowOrColumnNumber(nl.tudelft.simulation.dsol.simulators.SimulatorInterface simulator)
          constructs a new GlobalRowOrColumnNumber
 
Method Summary
static int getCurrentNumberDay()
           
static int getCurrentNumberMonth()
           
static int getCurrentNumberWeek()
           
 GlobalRowOrColumnNumber.CustomEventProducer getCustomEventProducer()
           
static java.util.ArrayList getDayHeaderValues()
           
static java.util.HashMap getDayNumberTableRowNumber()
           
static GlobalRowOrColumnNumber getGlobalRowOrColumnNumber()
           
static java.util.ArrayList getMonthHeaderValues()
           
static java.util.HashMap getMonthNumberTableRowNumber()
           
static int getNumberOfDays()
           
static java.util.Calendar getProgressCalendar()
           
static long getStartTime()
           
static java.util.ArrayList getWeekHeaderValues()
           
static java.util.HashMap getWeekNumberTableRowNumber()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UPDATE_CURRENT_DAY

public static final nl.tudelft.simulation.event.EventType UPDATE_CURRENT_DAY
fired when the current row or column must be updated according to the simulation time


UPDATE_CURRENT_WEEK

public static final nl.tudelft.simulation.event.EventType UPDATE_CURRENT_WEEK
fired when the current row or column must be updated according to the simulation time


UPDATE_CURRENT_MONTH

public static final nl.tudelft.simulation.event.EventType UPDATE_CURRENT_MONTH
fired when the current row or column must be updated according to the simulation time


UPDATE_CURRENT_DATE

public static final nl.tudelft.simulation.event.EventType UPDATE_CURRENT_DATE
fired when the date in the game has changed


UPDATE_CURRENT_DATES

public static final nl.tudelft.simulation.event.EventType UPDATE_CURRENT_DATES
fired when the all the columns and rows must be updated according to the simulation time


TOTAL_NUMBER_OF_DAYS

public static final nl.tudelft.simulation.event.EventType TOTAL_NUMBER_OF_DAYS
fired to indicate the total number of days in the simulation

Constructor Detail

GlobalRowOrColumnNumber

public GlobalRowOrColumnNumber(nl.tudelft.simulation.dsol.simulators.SimulatorInterface simulator)
constructs a new GlobalRowOrColumnNumber

Parameters:
simulator - the simulator
Method Detail

getCurrentNumberDay

public static int getCurrentNumberDay()
Returns:
Retuns the current number day

getCurrentNumberMonth

public static int getCurrentNumberMonth()
Returns:
Retuns the current number month

getCurrentNumberWeek

public static int getCurrentNumberWeek()
Returns:
Retuns the current number week

getDayHeaderValues

public static java.util.ArrayList getDayHeaderValues()
Returns:
Retuns the day header values

getWeekHeaderValues

public static java.util.ArrayList getWeekHeaderValues()
Returns:
Retuns the week header values

getMonthHeaderValues

public static java.util.ArrayList getMonthHeaderValues()
Returns:
Retuns the month header values

getGlobalRowOrColumnNumber

public static GlobalRowOrColumnNumber getGlobalRowOrColumnNumber()
Returns:
Retuns the GlobalRowOrColumnNumber instance

getDayNumberTableRowNumber

public static java.util.HashMap getDayNumberTableRowNumber()
Returns:
Retuns the day number table row number

getWeekNumberTableRowNumber

public static java.util.HashMap getWeekNumberTableRowNumber()
Returns:
Retuns the week number table row number

getMonthNumberTableRowNumber

public static java.util.HashMap getMonthNumberTableRowNumber()
Returns:
Retuns the month number table row number

getNumberOfDays

public static int getNumberOfDays()
Returns:
Returns the number of days in the simulation

getProgressCalendar

public static java.util.Calendar getProgressCalendar()
Returns:
Returns the progress calendar

getStartTime

public static long getStartTime()
Returns:
Returns the startTime

getCustomEventProducer

public GlobalRowOrColumnNumber.CustomEventProducer getCustomEventProducer()
Returns:
Retuns the custom event producer


Copyright © 2002-2005 Delft University of Technology, the Netherlands. All Rights Reserved.