MCPcopy Create free account
hub / github.com/NeuralNetworkVerification/Marabou / importDebuggingSolution

Method importDebuggingSolution

src/engine/Marabou.cpp:159–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

157}
158
159void Marabou::importDebuggingSolution()
160{
161 String fileName = Options::get()->getString( Options::IMPORT_ASSIGNMENT_FILE_PATH );
162 AutoFile input( fileName );
163
164 if ( !IFile::exists( fileName ) )
165 {
166 throw MarabouError( MarabouError::FILE_DOES_NOT_EXIST,
167 Stringf( "File %s not found.\n", fileName.ascii() ).ascii() );
168 }
169
170 input->open( IFile::MODE_READ );
171
172 unsigned numVars = atoi( input->readLine().trim().ascii() );
173 ASSERT( numVars == _inputQuery.getNumberOfVariables() );
174
175 unsigned var;
176 double value;
177 String line;
178
179 // Import each assignment
180 for ( unsigned i = 0; i < numVars; ++i )
181 {
182 line = input->readLine();
183 List<String> tokens = line.tokenize( "," );
184 auto it = tokens.begin();
185 var = atoi( it->ascii() );
186 ASSERT( var == i );
187 it++;
188 value = atof( it->ascii() );
189 it++;
190 ASSERT( it == tokens.end() );
191 _inputQuery.storeDebuggingSolution( var, value );
192 }
193
194 input->close();
195}
196
197void Marabou::exportAssignment() const
198{

Callers

nothing calls this directly

Calls 13

MarabouErrorClass · 0.85
StringfClass · 0.85
getStringMethod · 0.80
asciiMethod · 0.80
trimMethod · 0.80
tokenizeMethod · 0.80
openMethod · 0.45
readLineMethod · 0.45
getNumberOfVariablesMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected