public CircuitInstantiationTests()
        {
            circuitDefinition = CircuitGenerator.GetLinearCircuit();
            var modelCreators =
                new Dictionary <Type, Func <ICircuitDefinitionDevice, IModelInstantiationContext <LargeSignalCircuitModel>
                                            , IAnalysisDeviceModel <LargeSignalCircuitModel> > >
            {
                [typeof(Resistor)] =
                    (e, ctx) => new LargeSignalResistor((Resistor)e),
                [typeof(VoltageSource)] =
                    (e, ctx) => new LargeSignalVoltageSource((VoltageSource)e)
            };


            context = new ModelInstantiationContext <LargeSignalCircuitModel>(modelCreators,
                                                                              new Dictionary <Type, Func <object, IModelInstantiationContext <LargeSignalCircuitModel>, object> >(),
                                                                              circuitDefinition);
        }
示例#2
0
 public AnalysisModelFactoryTests()
 {
     definition = CircuitGenerator.GetCircuitWithBasicDevices();
     creator    = new AnalysisModelCreator();
 }