# A simulation of  work place version # 0.0.2 date 08-04-20 author Peter Timusk
# Do loops

#write up v0.0.1
#The time dimension: simulating the working week as a 
#straight forward measure 
#Now we will brieﬂy leave the domain of the sociology of knowledge and 
#explore a dimension of the simulation that is key to many computer simula- 
#tions and computer games, namely the dimension of time. In particular the 
#working week or work time must be established. 
#It is thought in the area of continuity management that having more time 
#for older workers to transfer key knowledge to their successors is better. Also 
#the simulation may use the time dimension as a proxy for knowledge. Mean- 
#ing it might be assumed that the longer a worker has been doing a job the 
#greater their knowledge. Of course, demographically we have the ma jor time 
#line of the baby boom. Time will also ﬁgure in any implementation of the 
#plans that are made to retain knowledge. The time dimension is also key to 
#deﬁning work itself. 

#The working week that has been coded so far is a 50 week year, with a 5 day 
#working week, and an 8 hour day. This is simply a series of nested loops. So 
#now within each loop moving out ward from the inside we ﬁnd the workplace 
#can be seen from inside a working hour, to inside a working day, to inside a 
#work week. to inside a working year. We will use this level of granularity for 
#the working time component of the ﬁrm. We can add overtime hours based 
#on new legislation enacted under pressures from the software industry. We 
#can adjust for seniority and longer vacations. We can ﬁne tune this model or 
#time cycles using collective agreements from various unions to add empiri- 
#cal validity to the simulation. At least this measure could be straight forward. 
#For each worker we will also have an age and when the above loop com- 
#pletes one yearly cycle the age of each worker at the ﬁrm will increment by 
#one. Also the experience or length of job tenure will increase by one. The 
#retirement age will aﬀect the length of time reaming in the job and shorten 
#this length by one year for each cycle of the above nested loops. 
#Finally the knowledge retention strategies, and programs will be measured 
#and thus simulated, at least partially by time. 
#end of write up v0.0.1

Simclock <- 0
hr <-0
Worker <- read.csv(file='/Data/Random100workerages16-66.csv', header=TRUE, sep=",")
for( i in 1:52) 
{

	for (j in 1:5) 
	{
		
		for(k in 1:8)
		{ hr <- hr +1
		}
Simclock <- Simclock + 24
	}
Simclock <- Simclock + 48
}
Simclock
Worker
attach(Worker)
plot(Worker)