<SYSTEM_TASK:>
Solve the following problem using Python, implementing the functions described below, one line at a time
<END_TASK>
<USER_TASK:>
Description:
 def update(self):
 """Determines in how many segments the whole reach needs to be divided to approximate the desired lag time via integer rounding. Adjusts the shape of sequence |QJoints| additionally. Required control parameters: |Lag| Calculated derived parameters: |NmbSegments| Prepared state sequence: |QJoints| Examples: Define a lag time of 1.4 days and a simulation step size of 12 hours: Then the actual lag value for the simulation step size is 2.8 lag(1.4) 2.8 Through rounding the number of segments is determined: nmbsegments(3) The number of joints is always the number of segments plus one: (4,) """

        pars = self.subpars.pars
        self(int(round(pars.control.lag)))
        pars.model.sequences.states.qjoints.shape = self+1