Download Summary

Transcript
A.4 ResourceStatistics.fs
73
f o r c o u r s e i n b a s i c C o u r s e L i s t do
scholar course
//
GUI c a l l s
l e t basicBLectures = List . fold
( fun s ( room , c o u r s e , t a b l e ) > s + ( s t r i n g room ) +
"��" + ( s t r i n g c o u r s e ) + "��" + t a b l e + "\n" ) ""
basicLectureAllocations
l e t basicBExercises = List . fold
( fun s ( room , c o u r s e , t a b l e ) > s + ( s t r i n g room ) +
"��" + ( s t r i n g c o u r s e ) + "��" + t a b l e + "\n" )
"" b a s i c E x e r c i s e A l l o c a t i o n s
l e t basicBruteForce = basicBLectures + basicBExercises
le t basicSchola =
runBasicScholar
allAllocationsToString
A.4
ResourceStatistics.fs
namespace R e s o u r c e S t a t i s t i c s
module S t a t i s t i c s =
open System
open ResourceQuery . Q u e r i e s
l e t distance id = findDistance
( ( f i n d E x e r c i s e R o o m i d ) , ( findLectureRoom i d ) )
l e t distancePerPerson id =
d i s t a n c e i d / Convert . ToDouble ( g e t S i z e O f C o u r s e i d )
l e t sumDistance = L i s t . f o l d
( fun d ( id , _,_) > d + d i s t a n c e i d )
0.0 allAllocatedCourses
l e t sumDistancePerPerson = L i s t . f o l d
( fun d ( id , _,_) > d + d i s t a n c e P e r P e r s o n i d )