Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- %% Anki scheduler simulation by Jantek Mikulski
- % Card's structure
- dueDate = 1;
- daysInterval = 2;
- ease = 3;
- cards = [1 1 2.5]; %initial card
- maxSimTime = 100*365; %maximal simulation time
- dueTable = zeros(maxSimTime, 1);
- today = 0; %today date
- numberOfCards = 1; % number of total cards
- %%
- startingEase = 2.5;
- easyBonus = 1.2;
- newCardsDaily = 10; % number of new cards each day
- endDate = 15*365; % for how many days should the simulation be run
- goodPercentage = 0.65;
- easyPercentage = 0.1;
- hardPercentage = 0.2; %the rest if forgotten
- newIntervalOnLapses = 0.1;
- while today < endDate
- % reviewing existing cards
- for N=1:numberOfCards
- if cards(N, dueDate) == today
- r = rand();
- if r < goodPercentage % good on card
- cards(N, daysInterval) = floor(cards(N, daysInterval)*cards(N, ease));
- cards(N, dueDate) = today+cards(N, daysInterval);
- elseif r < goodPercentage + easyPercentage % easy on card
- cards(N, daysInterval) = floor(cards(N, daysInterval)*cards(N, ease)*easyBonus);
- cards(N, dueDate) = today+cards(N, daysInterval);
- cards(N, ease) = cards(N, ease) + 0.15;
- elseif r < goodPercentage + easyPercentage + hardPercentage % hard on card
- cards(N, daysInterval) = floor(cards(N, daysInterval)*1.2);
- cards(N, dueDate) = today+cards(N, daysInterval);
- cards(N, ease) = max(1.3, cards(N, ease)-0.15);
- else % card forgotten (again)
- cards(N, daysInterval) = max(1, floor(cards(N, daysInterval)*newIntervalOnLapses));
- cards(N, dueDate) = today+cards(N, daysInterval);
- cards(N, ease) = max(1.3, cards(N, ease)-0.20);
- end
- dueTable(today+cards(N, daysInterval))=dueTable(today+cards(N, daysInterval))+1;
- end
- end
- %adding new cards
- for N=1:newCardsDaily
- cards = [cards; [today+1 1 startingEase]];
- numberOfCards = numberOfCards+1;
- end
- today = today + 1;
- end
- plot(dueTable(1:endDate+30));
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement