def configure(self):
        # pylint: disable-msg=E1101

        # Create CONMIN Optimizer instance
        self.add('driver', CONMINdriver())

        # Create Vehicle instance
        self.add('vehicle', Vehicle())

        # Create Driving Simulation instances
        self.add('sim_acc', SimAcceleration())
        self.add('sim_EPA_city', SimEconomy())
        self.add('sim_EPA_highway', SimEconomy())

        # add Sims to optimizer workflow
        self.driver.workflow.add(
            ['sim_acc', 'sim_EPA_city', 'sim_EPA_highway'])

        # Add vehicle to sim workflows.
        self.sim_acc.workflow.add('vehicle')
        self.sim_EPA_city.workflow.add('vehicle')
        self.sim_EPA_highway.workflow.add('vehicle')

        # CONMIN Flags
        self.driver.iprint = 0
        self.driver.itmax = 30

        # CONMIN Objective
        self.driver.add_objective('sim_acc.accel_time')

        # CONMIN Design Variables
        self.driver.add_parameter('vehicle.spark_angle', -50., 10.)
        self.driver.add_parameter('vehicle.bore', 65., 100.)

        # Acceleration Sim setup
        self.sim_acc.velocity_str = 'vehicle.velocity'
        self.sim_acc.throttle_str = 'vehicle.throttle'
        self.sim_acc.gear_str = 'vehicle.current_gear'
        self.sim_acc.acceleration_str = 'vehicle.acceleration'
        self.sim_acc.overspeed_str = 'vehicle.overspeed'

        # EPA City MPG Sim Setup
        self.sim_EPA_city.velocity_str = 'vehicle.velocity'
        self.sim_EPA_city.throttle_str = 'vehicle.throttle'
        self.sim_EPA_city.gear_str = 'vehicle.current_gear'
        self.sim_EPA_city.acceleration_str = 'vehicle.acceleration'
        self.sim_EPA_city.fuel_burn_str = 'vehicle.fuel_burn'
        self.sim_EPA_city.overspeed_str = 'vehicle.overspeed'
        self.sim_EPA_city.underspeed_str = 'vehicle.underspeed'
        self.sim_EPA_city.profilename = 'EPA-city.csv'

        # EPA Highway MPG Sim Setup
        self.sim_EPA_highway.velocity_str = 'vehicle.velocity'
        self.sim_EPA_highway.throttle_str = 'vehicle.throttle'
        self.sim_EPA_highway.gear_str = 'vehicle.current_gear'
        self.sim_EPA_highway.acceleration_str = 'vehicle.acceleration'
        self.sim_EPA_highway.fuel_burn_str = 'vehicle.fuel_burn'
        self.sim_EPA_highway.overspeed_str = 'vehicle.overspeed'
        self.sim_EPA_highway.underspeed_str = 'vehicle.underspeed'
        self.sim_EPA_highway.profilename = 'EPA-highway.csv'
Esempio n. 2
0
    def __init__(self):
        """ Creates a new Assembly for vehicle performance optimization."""
        
        super(VehicleSim2, self).__init__()

        # Create Vehicle instance
        self.add('vehicle', Vehicle())
        
        # Create Driving Simulation instances
        self.add('sim_acc', SimAcceleration())
        self.add('sim_EPA_city', SimEconomy())
        self.add('sim_EPA_highway', SimEconomy())
        
        # add Sims to default workflow
        self.driver.workflow.add(['sim_acc', 'sim_EPA_city', 'sim_EPA_highway'])
        
        # Add vehicle to sim workflows.
        self.sim_acc.workflow.add('vehicle')
        self.sim_EPA_city.workflow.add('vehicle')
        self.sim_EPA_highway.workflow.add('vehicle')
    
        # Acceleration Sim setup
        self.sim_acc.velocity_str = 'vehicle.velocity'
        self.sim_acc.throttle_str = 'vehicle.throttle'
        self.sim_acc.gear_str = 'vehicle.current_gear'
        self.sim_acc.acceleration_str = 'vehicle.acceleration'
        self.sim_acc.overspeed_str = 'vehicle.overspeed'
        
        # EPA City MPG Sim Setup
        self.sim_EPA_city.velocity_str = 'vehicle.velocity'
        self.sim_EPA_city.throttle_str = 'vehicle.throttle'
        self.sim_EPA_city.gear_str = 'vehicle.current_gear'
        self.sim_EPA_city.acceleration_str = 'vehicle.acceleration'
        self.sim_EPA_city.fuel_burn_str = 'vehicle.fuel_burn'
        self.sim_EPA_city.overspeed_str = 'vehicle.overspeed'
        self.sim_EPA_city.underspeed_str = 'vehicle.underspeed'
        self.sim_EPA_city.profilename = 'EPA-city.csv'
        self.sim_EPA_city.force_execute = True
        
        # EPA Highway MPG Sim Setup
        self.sim_EPA_highway.velocity_str = 'vehicle.velocity'
        self.sim_EPA_highway.throttle_str = 'vehicle.throttle'
        self.sim_EPA_highway.gear_str = 'vehicle.current_gear'
        self.sim_EPA_highway.acceleration_str = 'vehicle.acceleration'
        self.sim_EPA_highway.fuel_burn_str = 'vehicle.fuel_burn'
        self.sim_EPA_highway.overspeed_str = 'vehicle.overspeed'
        self.sim_EPA_highway.underspeed_str = 'vehicle.underspeed'
        self.sim_EPA_highway.profilename = 'EPA-highway.csv'        
        self.sim_EPA_highway.force_execute = True
Esempio n. 3
0
    def setUp(self):
        
        self.top = set_as_top(Assembly())

        self.top.add('sim_acc', SimAcceleration())
        self.top.add('sim_EPA_city', SimEconomy())
        self.top.add('vehicle', Vehicle())
        
        self.top.driver.workflow.add('sim_acc')
        self.top.driver.workflow.add('sim_EPA_city')
        self.top.driver.workflow.add('sim_EPA_highway')
        
        self.top.sim_acc.workflow.add('vehicle')
        self.top.sim_acc.velocity_str = 'vehicle.velocity'
        self.top.sim_acc.throttle_str = 'vehicle.throttle'
        self.top.sim_acc.gear_str = 'vehicle.current_gear'
        self.top.sim_acc.acceleration_str = 'vehicle.acceleration'
        self.top.sim_acc.overspeed_str = 'vehicle.overspeed'
        
        self.top.sim_EPA_city.workflow.add('vehicle')
        self.top.sim_EPA_city.velocity_str = 'vehicle.velocity'
        self.top.sim_EPA_city.throttle_str = 'vehicle.throttle'
        self.top.sim_EPA_city.gear_str = 'vehicle.current_gear'
        self.top.sim_EPA_city.acceleration_str = 'vehicle.acceleration'
        self.top.sim_EPA_city.fuel_burn_str = 'vehicle.fuel_burn'
        self.top.sim_EPA_city.overspeed_str = 'vehicle.overspeed'
        self.top.sim_EPA_city.underspeed_str = 'vehicle.underspeed'
        self.top.sim_EPA_city.profilename = 'EPA-city.csv'
Esempio n. 4
0
    def setUp(self):

        self.top = set_as_top(Assembly())

        self.top.add('sim_acc', SimAcceleration())
        self.top.add('sim_EPA_city', SimEconomy())
        self.top.add('vehicle', Vehicle())

        self.top.driver.workflow.add('sim_acc')
        self.top.driver.workflow.add('sim_EPA_city')
        self.top.driver.workflow.add('sim_EPA_highway')

        self.top.sim_acc.workflow.add('vehicle')
        self.top.sim_acc.add_parameter('vehicle.velocity', name='velocity',
                                       low=0.0, high=150.0)
        self.top.sim_acc.add_parameter('vehicle.throttle', name='throttle',
                                       low=0.01, high=1.0)
        self.top.sim_acc.add_parameter('vehicle.current_gear', name='gear',
                                       low=0, high=5)
        self.top.sim_acc.add_objective('vehicle.acceleration', name='acceleration')
        self.top.sim_acc.add_objective('vehicle.overspeed', name='overspeed')

        self.top.sim_EPA_city.workflow.add('vehicle')
        self.top.sim_EPA_city.add_parameter('vehicle.velocity', name='velocity',
                                            low=0.0, high=150.0)
        self.top.sim_EPA_city.add_parameter('vehicle.throttle', name='throttle',
                                            low=0.01, high=1.0)
        self.top.sim_EPA_city.add_parameter('vehicle.current_gear', name='gear',
                                            low=0, high=5)
        self.top.sim_EPA_city.add_objective('vehicle.acceleration', name='acceleration')
        self.top.sim_EPA_city.add_objective('vehicle.fuel_burn', name='fuel_burn')
        self.top.sim_EPA_city.add_objective('vehicle.overspeed', name='overspeed')
        self.top.sim_EPA_city.add_objective('vehicle.underspeed', name='underspeed')
        self.top.sim_EPA_city.profilename = 'EPA-city.csv'
    def __init__(self):
        """ Creates a new Assembly for vehicle performance optimization."""

        super(EngineOptimization, self).__init__()

        # pylint: disable-msg=E1101

        # Create CONMIN Optimizer instance
        self.add('optimizer', CONMINdriver())

        # Create Vehicle instance
        self.add('vehicle', Vehicle())

        # Create Driving Simulation instances
        self.add('sim_acc', SimAcceleration())
        self.add('sim_EPA_city', SimEconomy())
        self.add('sim_EPA_highway', SimEconomy())

        # add the optimizer and economy sims to driver workflow
        self.driver.workflow.add(
            ['optimizer', 'sim_EPA_city', 'sim_EPA_highway'])

        # add the acceleration sim to the optimizer workflow
        self.optimizer.workflow.add('sim_acc')

        # Add vehicle to sim workflows.
        self.sim_acc.workflow.add('vehicle')
        self.sim_EPA_city.workflow.add('vehicle')
        self.sim_EPA_highway.workflow.add('vehicle')

        # CONMIN Flags
        self.optimizer.iprint = 0
        self.optimizer.itmax = 30

        # CONMIN Objective
        self.optimizer.add_objective('sim_acc.accel_time')

        # CONMIN Design Variables
        self.optimizer.add_parameter('vehicle.spark_angle', -50., 10.)
        self.optimizer.add_parameter('vehicle.bore', 65., 100.)

        # Acceleration Sim setup
        self.sim_acc.velocity_str = 'vehicle.velocity'
        self.sim_acc.throttle_str = 'vehicle.throttle'
        self.sim_acc.gear_str = 'vehicle.current_gear'
        self.sim_acc.acceleration_str = 'vehicle.acceleration'
        self.sim_acc.overspeed_str = 'vehicle.overspeed'

        # EPA City MPG Sim Setup
        self.sim_EPA_city.velocity_str = 'vehicle.velocity'
        self.sim_EPA_city.throttle_str = 'vehicle.throttle'
        self.sim_EPA_city.gear_str = 'vehicle.current_gear'
        self.sim_EPA_city.acceleration_str = 'vehicle.acceleration'
        self.sim_EPA_city.fuel_burn_str = 'vehicle.fuel_burn'
        self.sim_EPA_city.overspeed_str = 'vehicle.overspeed'
        self.sim_EPA_city.underspeed_str = 'vehicle.underspeed'
        self.sim_EPA_city.profilename = 'EPA-city.csv'
        self.sim_EPA_city.force_execute = True

        # EPA Highway MPG Sim Setup
        self.sim_EPA_highway.velocity_str = 'vehicle.velocity'
        self.sim_EPA_highway.throttle_str = 'vehicle.throttle'
        self.sim_EPA_highway.gear_str = 'vehicle.current_gear'
        self.sim_EPA_highway.acceleration_str = 'vehicle.acceleration'
        self.sim_EPA_highway.fuel_burn_str = 'vehicle.fuel_burn'
        self.sim_EPA_highway.overspeed_str = 'vehicle.overspeed'
        self.sim_EPA_highway.underspeed_str = 'vehicle.underspeed'
        self.sim_EPA_highway.profilename = 'EPA-highway.csv'
        self.sim_EPA_highway.force_execute = True
Esempio n. 6
0
    def configure(self):

        # pylint: disable-msg=E1101
        
        # Create CONMIN Optimizer instance
        self.add('optimizer', CONMINdriver())
        
        # Create Vehicle instance
        self.add('vehicle', Vehicle())
        
        # Create Driving Simulation instances
        self.add('sim_acc', SimAcceleration())
        self.add('sim_EPA_city', SimEconomy())
        self.add('sim_EPA_highway', SimEconomy())
        
        # add the optimizer and economy sims to driver workflow
        self.driver.workflow.add(['optimizer', 'sim_EPA_city', 'sim_EPA_highway'])
        
        # add the acceleration sim to the optimizer workflow
        self.optimizer.workflow.add('sim_acc')
        
        # Add vehicle to sim workflows.
        self.sim_acc.workflow.add('vehicle')
        self.sim_EPA_city.workflow.add('vehicle')
        self.sim_EPA_highway.workflow.add('vehicle')
    
        # CONMIN Flags
        self.optimizer.iprint = 0
        self.optimizer.itmax = 30
        self.optimizer.conmin_diff = True
        
        # CONMIN Objective 
        self.optimizer.add_objective('sim_acc.accel_time')
        
        # CONMIN Design Variables 
        self.optimizer.add_parameter('vehicle.spark_angle', -50., 10.)
        self.optimizer.add_parameter('vehicle.bore', 65., 100.)
        
        # Acceleration Sim setup
        self.sim_acc.add_parameter('vehicle.velocity', name='velocity',
                                  low=0.0, high=150.0)
        self.sim_acc.add_parameter('vehicle.throttle', name='throttle',
                                  low=0.01, high=1.0)
        self.sim_acc.add_parameter('vehicle.current_gear', name='gear',
                                  low=0, high=5)
        self.sim_acc.add_objective('vehicle.acceleration', name='acceleration')
        self.sim_acc.add_objective('vehicle.overspeed', name='overspeed')
        
        # EPA City MPG Sim Setup
        self.sim_EPA_city.add_parameter('vehicle.velocity', name='velocity',
                                  low=0.0, high=150.0)
        self.sim_EPA_city.add_parameter('vehicle.throttle', name='throttle',
                                  low=0.01, high=1.0)
        self.sim_EPA_city.add_parameter('vehicle.current_gear', name='gear',
                                  low=0, high=5)
        self.sim_EPA_city.add_objective('vehicle.acceleration', name='acceleration')
        self.sim_EPA_city.add_objective('vehicle.fuel_burn', name='fuel_burn')
        self.sim_EPA_city.add_objective('vehicle.overspeed', name='overspeed')
        self.sim_EPA_city.add_objective('vehicle.underspeed', name='underspeed')
        self.sim_EPA_city.profilename = 'EPA-city.csv'
        
        # EPA Highway MPG Sim Setup
        self.sim_EPA_highway.add_parameter('vehicle.velocity', name='velocity',
                                  low=0.0, high=150)
        self.sim_EPA_highway.add_parameter('vehicle.throttle', name='throttle',
                                  low=0.01, high=1.0)
        self.sim_EPA_highway.add_parameter('vehicle.current_gear', name='gear',
                                  low=0, high=5)
        self.sim_EPA_highway.add_objective('vehicle.acceleration', name='acceleration')
        self.sim_EPA_highway.add_objective('vehicle.fuel_burn', name='fuel_burn')
        self.sim_EPA_highway.add_objective('vehicle.overspeed', name='overspeed')
        self.sim_EPA_highway.add_objective('vehicle.underspeed', name='underspeed')
        self.sim_EPA_highway.profilename = 'EPA-highway.csv'
Esempio n. 7
0
    def configure(self):
        """ Configures a new Assembly for vehicle performance optimization."""

        # Create Vehicle instance
        self.add('vehicle', Vehicle())

        # Create Driving Simulation instances
        self.add('sim_acc', SimAcceleration())
        self.add('sim_EPA_city', SimEconomy())
        self.add('sim_EPA_highway', SimEconomy())

        # add Sims to default workflow
        self.driver.workflow.add(
            ['sim_acc', 'sim_EPA_city', 'sim_EPA_highway'])

        # Add vehicle to sim workflows.
        self.sim_acc.workflow.add('vehicle')
        self.sim_EPA_city.workflow.add('vehicle')
        self.sim_EPA_highway.workflow.add('vehicle')

        # Acceleration Sim setup
        self.sim_acc.add_parameter('vehicle.velocity',
                                   name='velocity',
                                   low=0.0,
                                   high=150.0)
        self.sim_acc.add_parameter('vehicle.throttle',
                                   name='throttle',
                                   low=0.01,
                                   high=1.0)
        self.sim_acc.add_parameter('vehicle.current_gear',
                                   name='gear',
                                   low=0,
                                   high=5)
        self.sim_acc.add_objective('vehicle.acceleration', name='acceleration')
        self.sim_acc.add_objective('vehicle.overspeed', name='overspeed')

        # EPA City MPG Sim Setup
        self.sim_EPA_city.add_parameter('vehicle.velocity',
                                        name='velocity',
                                        low=0.0,
                                        high=150.0)
        self.sim_EPA_city.add_parameter('vehicle.throttle',
                                        name='throttle',
                                        low=0.01,
                                        high=1.0)
        self.sim_EPA_city.add_parameter('vehicle.current_gear',
                                        name='gear',
                                        low=0,
                                        high=5)
        self.sim_EPA_city.add_objective('vehicle.acceleration',
                                        name='acceleration')
        self.sim_EPA_city.add_objective('vehicle.fuel_burn', name='fuel_burn')
        self.sim_EPA_city.add_objective('vehicle.overspeed', name='overspeed')
        self.sim_EPA_city.add_objective('vehicle.underspeed',
                                        name='underspeed')
        self.sim_EPA_city.profilename = 'EPA-city.csv'

        # EPA Highway MPG Sim Setup
        self.sim_EPA_highway.add_parameter('vehicle.velocity',
                                           name='velocity',
                                           low=0.0,
                                           high=150)
        self.sim_EPA_highway.add_parameter('vehicle.throttle',
                                           name='throttle',
                                           low=0.01,
                                           high=1.0)
        self.sim_EPA_highway.add_parameter('vehicle.current_gear',
                                           name='gear',
                                           low=0,
                                           high=5)
        self.sim_EPA_highway.add_objective('vehicle.acceleration',
                                           name='acceleration')
        self.sim_EPA_highway.add_objective('vehicle.fuel_burn',
                                           name='fuel_burn')
        self.sim_EPA_highway.add_objective('vehicle.overspeed',
                                           name='overspeed')
        self.sim_EPA_highway.add_objective('vehicle.underspeed',
                                           name='underspeed')
        self.sim_EPA_highway.profilename = 'EPA-highway.csv'