Cody

# Problem 44655. Computational power of Cody servers

Solution 1687405

Submitted on 6 Dec 2018
This solution is locked. To view this solution, you need to provide a solution of the same size or smaller.

### Test Suite

Test Status Code Input and Output
1   Pass
% ADDED 2019-06-29. % Ensure only builtin functions will be called. ! rm -v fileread.m ! rm -v assert.m

rm: cannot remove 'fileread.m': No such file or directory rm: cannot remove 'assert.m': No such file or directory

2   Fail
assessFunctionPresence({'fminsearch', 'optimset'}, 'FileName','predictor.m', 'Feedback','You must use the specified methodology')

The submission must contain the following functions or keywords: fminsearch, optimset You must use the specified methodology

3   Pass

4   Fail
futureDate = '22-Jan-2019'; predictedRuntime_correct = round(0.935043294718475, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct)) futureDate = '23-Jan-2019'; predictedRuntime_correct = round(0.934448955935569, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct)) futureDate = '24-Jan-2019'; predictedRuntime_correct = round(0.933855075296061, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In predictor (line 2) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 11)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/satisfiedBy In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 11)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/getDiagnosticFor In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint4 (line 3) In solutionTest (line 11)]

The submission must contain the following functions or keywords: fminsearch, optimset You must use the specified methodology

5   Fail
futureDate = '09-Jan-2020'; predictedRuntime_correct = round(0.751755426901932, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct)) futureDate = '13-Jan-2020'; predictedRuntime_correct = round(0.749945312632780, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In predictor (line 2) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 13)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/satisfiedBy In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 13)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/getDiagnosticFor In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint5 (line 3) In solutionTest (line 13)]

The submission must contain the following functions or keywords: fminsearch, optimset You must use the specified methodology

6   Fail
futureDate = '06-Jan-2021'; predictedRuntime_correct = round(0.608254613313523, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct)) futureDate = '11-Jan-2021'; predictedRuntime_correct = round(0.606545074994730, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In predictor (line 2) In ScoringEngineTestPoint6 (line 3) In solutionTest (line 15)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/satisfiedBy In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint6 (line 3) In solutionTest (line 15)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/getDiagnosticFor In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint6 (line 3) In solutionTest (line 15)]

The submission must contain the following functions or keywords: fminsearch, optimset You must use the specified methodology

7   Fail
futureDate = '06-Feb-2022'; predictedRuntime_correct = round(0.491354117473879, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct)) futureDate = '10-Feb-2022'; predictedRuntime_correct = round(0.490345992043568, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In predictor (line 2) In ScoringEngineTestPoint7 (line 3) In solutionTest (line 17)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/satisfiedBy In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint7 (line 3) In solutionTest (line 17)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/getDiagnosticFor In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint7 (line 3) In solutionTest (line 17)]

The submission must contain the following functions or keywords: fminsearch, optimset You must use the specified methodology

8   Fail
futureDate = '06-Nov-2023'; predictedRuntime_correct = round(0.364155581026111, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct)) futureDate = '21-Nov-2023'; predictedRuntime_correct = round(0.361853937995679, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct)) futureDate = '25-Nov-2023'; predictedRuntime_correct = round(0.361244649648014, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct)) futureDate = '27-Nov-2023'; predictedRuntime_correct = round(0.360940709522436, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In predictor (line 2) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 19)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/satisfiedBy In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 19)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/getDiagnosticFor In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint8 (line 3) In solutionTest (line 19)]

The submission must contain the following functions or keywords: fminsearch, optimset You must use the specified methodology

9   Fail
futureDate = '01-Jan-3000'; predictedRuntime_correct = round(0.164021404839, 4); assert(isequal(predictor(futureDate, data), predictedRuntime_correct))

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In predictor (line 2) In ScoringEngineTestPoint9 (line 3) In solutionTest (line 21)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/satisfiedBy In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint9 (line 3) In solutionTest (line 21)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/getDiagnosticFor In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint9 (line 3) In solutionTest (line 21)]

The submission must contain the following functions or keywords: fminsearch, optimset You must use the specified methodology

10   Fail
% Assure no 'workarounds' that avoid appropriate use of optimset. % (Added 29 May 2018.) futureDate = {'19-Dec-2019'; '04-Oct-2020'; '06-Nov-2020'; '20-Nov-2020'; '07-Dec-2020'; '09-Dec-2020'; '11-Dec-2020'; '25-Feb-2021'; '04-Mar-2021'; '18-Apr-2021'; '19-May-2021'; '23-Jul-2021'}; pRuntime_c_unrounded = {0.761350673860113 0.641651747331991 0.629650497697623 0.624650604424140 0.618651428148657 0.617950799242008 0.617251250072375 0.591452258418511 0.589151203003048 0.574651625923890 0.564951737257372 0.545350739105932}; for j = 1 : length(futureDate) assert(isequal(predictor(futureDate{j}, data), round(pRuntime_c_unrounded{j}, 4))) end;

[Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In predictor (line 2) In ScoringEngineTestPoint10 (line 6) In solutionTest (line 23)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/satisfiedBy In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint10 (line 6) In solutionTest (line 23)] [Warning: Function assert has the same name as a MATLAB builtin. We suggest you rename the function to avoid a potential name conflict.] [> In matlab.internal.getCode (line 22) In mtree (line 118) In FileReadHelper/generateMtree In FileReadHelper/generateFileMetadata In FunctionPresenceConstraint/getNotPresentFunctions In FunctionPresenceConstraint/getDiagnosticFor In assessFunctionPresence In predictor (line 3) In ScoringEngineTestPoint10 (line 6) In solutionTest (line 23)]

The submission must contain the following functions or keywords: fminsearch, optimset You must use the specified methodology