An engine comprising: a combustion chamber; a state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56) mounted to the engine, the state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56) configured to adjust introduction of fresh air and burned gas into the combustion chamber; an injector mounted to the engine, the injector configured to inject fuel; a spark plug disposed so as to face an inside of the combustion chamber; and a controller connected to the state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56), the injector, and the spark plug, the controller configured to output control signals to the state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56), the injector, and the spark plug, wherein after the spark plug ignites air-fuel mixture to start combustion, combustion of unburned air-fuel mixture is caused by autoignition, and the controller is configured to output a control signal to the state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56) such that, as the number of revolutions of the engine is increased, a temperature in the combustion chamber before start of compression is increased, during SPCCI combustion in which the spark plug forcibly ignites the air-fuel mixture in the combustion chamber, to combust the air-fuel mixture by flame propagation, and heat generation increases the temperature in the combustion chamber, to combust the unburned air-fuel mixture by the autoignition; characterized by a mechanical supercharger configured to be switched between a state where the mechanical supercharger performs supercharging with gas that is to be introduced into the combustion chamber and a state where the supercharger does not perform supercharging with gas that is to be introduced into the combustion chamber, wherein the state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56) has a variable valve mechanism (23, 24) provided to the engine and configured to receive a control signal from the controller and change an opening time of at least one of an intake valve and an exhaust valve, and the variable valve mechanism (23, 24) is configured to receive a control signal from the controller, and shorten an overlap period in which both the intake valve and the exhaust valve are opened, as the number of revolutions of the engine is increased, such that the temperature in the combustion chamber before start of compression is increased, during supercharging SPCCI combustion in which gas to be introduced into the combustion chamber is supercharged and the spark plug forcibly ignites the air-fuel mixture in the combustion chamber, to combust the air-fuel mixture by flame propagation, and heat generation increases the temperature in the combustion chamber, to combust the unburned air-fuel mixture by the autoignition. a combustion chamber; a state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56) mounted to the engine, the state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56) configured to adjust introduction of fresh air and burned gas into the combustion chamber; an injector mounted to the engine, the injector configured to inject fuel; a spark plug disposed so as to face an inside of the combustion chamber; and a controller connected to the state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56), the injector, and the spark plug, the controller configured to output control signals to the state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56), the injector, and the spark plug, wherein after the spark plug ignites air-fuel mixture to start combustion, combustion of unburned air-fuel mixture is caused by autoignition, and the controller is configured to output a control signal to the state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56) such that, as the number of revolutions of the engine is increased, a temperature in the combustion chamber before start of compression is increased, during SPCCI combustion in which the spark plug forcibly ignites the air-fuel mixture in the combustion chamber, to combust the air-fuel mixture by flame propagation, and heat generation increases the temperature in the combustion chamber, to combust the unburned air-fuel mixture by the autoignition; characterized by a mechanical supercharger configured to be switched between a state where the mechanical supercharger performs supercharging with gas that is to be introduced into the combustion chamber and a state where the supercharger does not perform supercharging with gas that is to be introduced into the combustion chamber, wherein the state quantity setting device (23, 24, 43, 48, 54, 551, 552, 56) has a variable valve mechanism (23, 24) provided to the engine and configured to receive a control signal from the controller and change an opening time of at least one of an intake valve and an exhaust valve, and the variable valve mechanism (23, 24) is configured to receive a control signal from the controller, and shorten an overlap period in which both the intake valve and the exhaust valve are opened, as the number of revolutions of the engine is increased, such that the temperature in the combustion chamber before start of compression is increased, during supercharging SPCCI combustion in which gas to be introduced into the combustion chamber is supercharged and the spark plug forcibly ignites the air-fuel mixture in the combustion chamber, to combust the air-fuel mixture by flame propagation, and heat generation increases the temperature in the combustion chamber, to combust the unburned air-fuel mixture by the autoignition.