Esempio n. 1
0
 public ISelectState Select(string column)
 {
     return(StateProxy.CreateFor(State.Select(column)));
 }
Esempio n. 2
0
 public IOrderByState OrderBy(string column)
 {
     return(StateProxy.CreateFor(State.OrderBy(column)));
 }
Esempio n. 3
0
        private static IRenderingEngine createRenderingEngine(bool enableSoftwareRendering)
        {
            // Build the rendering pipeline, from the last entry to the first one.
            IRenderingEngine re;

            if (enableSoftwareRendering)
            {
                // RenderingEngine using a complete software implementation, i.e. not using the GPU
                re = new RESoftware();
            }
            else
            {
                // RenderingEngine performing the OpenGL calls by using the LWJGL library
                re = RenderingEngineLwjgl.newInstance();
            }

            if (enableCheckErrorsProxy)
            {
                re = new CheckErrorsProxy(re);
            }

            if (enableStatisticsProxy && DurationStatistics.collectStatistics)
            {
                // Proxy collecting statistics for all the calls (number of calls and execution time)
                re = new StatisticsProxy(re);
            }

            if (enableDebugProxy)
            {
                // Proxy logging the calls at the DEBUG level
                re = new DebugProxy(re);
            }

            if (!enableSoftwareRendering)
            {
                if (REShader.useShaders(re))
                {
                    // RenderingEngine using shaders
                    re = new REShader(re);
                }
                else
                {
                    // RenderingEngine using the OpenGL fixed-function pipeline (i.e. without shaders)
                    re = new REFixedFunction(re);
                }
            }

            // Proxy removing redundant calls.
            // E.g. calls setting multiple times the same value,
            // or calls with an invalid parameter (e.g. for unused shader uniforms).
            // In the rendering pipeline, the State Proxy has to be called after
            // the Anisotropic/Viewport filters. These are modifying some parameters
            // and the State Proxy has to use the sealed override parameter values.
            re = new StateProxy(re);

            // Proxy implementing a texture anisotropic filter
            re = new AnisotropicFilter(re);

            // Proxy implementing a viewport resizing filter
            re = new ViewportFilter(re);

            // Return the first entry in the pipeline
            return(re);
        }
        public static GenericCudaAlgorithm AlgorithmForFunction(CudaParams parameters, StateProxy proxy)
        {
            switch (parameters.FunctionNumber)
            {
                case 1:
                    return new SphereAlgorithm(parameters, proxy);

                case 2:
                    return new EllipsoidalAlgorithm(parameters, proxy);

                case 3:
                    return new RastriginAlgorithm(parameters, proxy);

                case 4:
                    return new BuecheRastriginAlgorithm(parameters, proxy);

                case 5:
                    return new LinearSlopeAlgorithm(parameters, proxy);

                case 6:
                    return new AttractiveSectorAlgorithm(parameters, proxy);

                case 7:
                    return new StepEllipsoidAlgorithm(parameters, proxy);

                case 8:
                    return new RosenbrockAlgorithm(parameters, proxy);

                case 9:
                    return new RosenbrockRotatedAlgorithm(parameters, proxy);

                case 10:
                    return new EllipsoidalRotatedAlgorithm(parameters, proxy);

                case 11:
                    return new DiscusAlgorithm(parameters, proxy);

                case 12:
                    return new BentCigarAlgorithm(parameters, proxy);

                case 13:
                    return new SharpRidgeAlgorithm(parameters, proxy);

                case 14:
                    return new DifferentPowersAlgorithm(parameters, proxy);

                case 15:
                    return new RastriginRotatedAlgorithm(parameters, proxy);

                case 16:
                    return new WeierstrassAlgorithm(parameters, proxy);

                case 17:
                    return new SchaffersAlgorithm(parameters, proxy)
                    {
                        Conditioning = 10.0,
                        IllformedSeed = false
                    };

                case 18:
                    return new SchaffersAlgorithm(parameters, proxy)
                    {
                        Conditioning = 1000.0,
                        IllformedSeed = true
                    };

                case 19:
                    return new GriewankRosenbrockAlgorithm(parameters, proxy);

                case 20:
                    return new SchwefelAlgorithm(parameters, proxy);

                case 21:
                    return new GallagherAlgorithm(parameters, proxy)
                    {
                        PeaksCount = 101
                    };

                case 22:
                    return new GallagherAlgorithm(parameters, proxy)
                    {
                        PeaksCount = 21
                    };

                case 23:
                    return new KatsuuraAlgorithm(parameters, proxy);

                case 24:
                    return new LunacekBiRastriginAlgorithm(parameters, proxy);

                default:
                    return null;
            }
        }
Esempio n. 5
0
        public static GenericCudaAlgorithm AlgorithmForFunction(CudaParams parameters, StateProxy proxy)
        {
            switch (parameters.FunctionNumber)
            {
            case 1:
                return(new SphereAlgorithm(parameters, proxy));

            case 2:
                return(new EllipsoidalAlgorithm(parameters, proxy));

            case 3:
                return(new RastriginAlgorithm(parameters, proxy));

            case 4:
                return(new BuecheRastriginAlgorithm(parameters, proxy));

            case 5:
                return(new LinearSlopeAlgorithm(parameters, proxy));

            case 6:
                return(new AttractiveSectorAlgorithm(parameters, proxy));

            case 7:
                return(new StepEllipsoidAlgorithm(parameters, proxy));

            case 8:
                return(new RosenbrockAlgorithm(parameters, proxy));

            case 9:
                return(new RosenbrockRotatedAlgorithm(parameters, proxy));

            case 10:
                return(new EllipsoidalRotatedAlgorithm(parameters, proxy));

            case 11:
                return(new DiscusAlgorithm(parameters, proxy));

            case 12:
                return(new BentCigarAlgorithm(parameters, proxy));

            case 13:
                return(new SharpRidgeAlgorithm(parameters, proxy));

            case 14:
                return(new DifferentPowersAlgorithm(parameters, proxy));

            case 15:
                return(new RastriginRotatedAlgorithm(parameters, proxy));

            case 16:
                return(new WeierstrassAlgorithm(parameters, proxy));

            case 17:
                return(new SchaffersAlgorithm(parameters, proxy)
                {
                    Conditioning = 10.0,
                    IllformedSeed = false
                });

            case 18:
                return(new SchaffersAlgorithm(parameters, proxy)
                {
                    Conditioning = 1000.0,
                    IllformedSeed = true
                });

            case 19:
                return(new GriewankRosenbrockAlgorithm(parameters, proxy));

            case 20:
                return(new SchwefelAlgorithm(parameters, proxy));

            case 21:
                return(new GallagherAlgorithm(parameters, proxy)
                {
                    PeaksCount = 101
                });

            case 22:
                return(new GallagherAlgorithm(parameters, proxy)
                {
                    PeaksCount = 21
                });

            case 23:
                return(new KatsuuraAlgorithm(parameters, proxy));

            case 24:
                return(new LunacekBiRastriginAlgorithm(parameters, proxy));

            default:
                return(null);
            }
        }