Mercurial > hg > simscene-py
annotate nonExposed/checkOverlapping.m @ 51:ebf92ed7d680 tip master
Added -fd (--full-duration) argument.
author | Emmanouil Theofanis Chourdakis <e.t.chourdakis@qmul.ac.uk> |
---|---|
date | Sun, 30 Sep 2018 13:21:49 +0100 |
parents | b1901e8d8f5f |
children |
rev | line source |
---|---|
mathieu@14 | 1 function [] = checkcOverlapping(sceneSchedule,sceneDuration) |
mathieu@14 | 2 %% check overlapping |
mathieu@14 | 3 onset=[sceneSchedule(2:end).position]; |
mathieu@14 | 4 offset=[sceneSchedule(2:end).duration]+onset; |
mathieu@14 | 5 [~,index]=sort(onset); |
mathieu@14 | 6 onset=onset(index); |
mathieu@14 | 7 offset=offset(index); |
mathieu@14 | 8 coveringIndice=onset(2:end)-offset(1:end-1); |
mathieu@14 | 9 if(find(coveringIndice<0)) |
mathieu@14 | 10 error('covering is not respected') |
mathieu@14 | 11 end |
mathieu@14 | 12 |
mathieu@14 | 13 %% check sceneDuration |
mathieu@14 | 14 if(offset(end)>sceneDuration+0.1) |
mathieu@14 | 15 error('Last event length is superior to the scene Duration') |
mathieu@14 | 16 end |
mathieu@14 | 17 |