# A simulation of work place version # 0.0.3 date 08-08-24 author Peter Timusk # Do loops # Data files are stored in the root directory in a folder named "Data" #write up v0.0.1 #The time dimension: simulating the working week as a #straight forward measure #Now we will briefly 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 figure in any implementation of the #plans that are made to retain knowledge. The time dimension is also key to #defining 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 find 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 firm. 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 fine 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 firm will increment by #one. Also the experience or length of job tenure will increase by one. The #retirement age will affect 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 for v 0.0.1 #write up v0.0.3 08-08-24 # now we add some knowledge variables # we chose seven variables based on the book # Continuity Management, Hamilton Beazley, Jeremiah Boenisch and David # Harden (2002) # cognitive knowledge is represented by the variable CognKnow # skills knowledge is represented by the variable SkilKnow # systems knowledge is represented by the variable SysKnow, # social network knowledge is represented by the variable SocNetKnow # process and procedural knowledge is represented by the variable Proc2Know # heuristic knowledge is represented by the variable HeurKnow # cultural knowledge is represented by the variable CultKnow. # we now initialise these variables with time referenced dataframes with # the first column # The second column is to be a worker ID and # the next four columns are to be the time. # these are Hour (0-23), day(1-7), Month(1-12), year(zero for now). # there are two files with the second being for leap years. # at this point we make three plus seven other columns # to reference the seven knowledge variables above and # three future use knowledge variables Know1, Know2, and Know3 # and an abritary two dummy columns Dummy1 and Dummy2. # Ideally we would like to have 7 factorial other number of columns so that # we cover all combos of the variables but we may be able to do this with # numerical or coded values # for rows we chose 8760 + 1 = 8761 for a normal year # which is hours in one year. # for the leap year we have an extra 24 hours so 8785 rows. # Note: this is a sort of data base design version. #all values are set to zero except the time values. #end of write up for v 0.0.3 # new code version 0.0.3 starts here knowDaysLeap <- read.csv(file='/Data/knowDaysLeap.csv', header=TRUE, sep=",") knowDaysNorm <- read.csv(file='/Data/knowDaysNorm.csv', header=TRUE, sep=",") knowHoursLeap <- read.csv(file='/Data/knowHoursLeap.csv', header=TRUE, sep=",") knowHoursNorm <- read.csv(file='/Data/knowHoursNorm.csv', header=TRUE, sep=",") knowMonthsLeap <- read.csv(file='/Data/knowMonthsLeap.csv', header=TRUE, sep=",") knowMonthsNorm <- read.csv(file='/Data/knowMonthsNorm.csv', header=TRUE, sep=",") # warning to users do not print the display of these variables as they will # take hundreds of pages of paper to print. #end of version 0.0.3 new code 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)