设为首页收藏本站

最大的系统仿真与系统优化公益交流社区

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 11484|回复: 2

[求助] Automod Syntax 编译的一个问题

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
$ h, V2 K  X7 X0 P, s1 L3 E; r1 H& B6 M0 m/ n3 r0 j: W
我的问题是,在每个P_pick的process中的while循环内,总显示错误Expecting QueuePtr or Location, but found PathPtr. 在我定义所有的attribute的时候,从来没有定义过任何QueuePtr or location or PathPtr,为什么会出现这种错误呢。 我这里面A_picks是一个30x1的array的load attribute,我想用A_i这个load attribute来读取这个array中的数值,不知道会不会有什么不妥。
5 O( M7 D! G) k3 Y
. }$ W' f. m+ ~begin P_read arriving  r, U# R! I3 ~/ [9 K* Y3 ?
    while 1=1 do begin
) Z% c9 s7 R) c0 F8 x5 H- N' F* U% Y        read A_tote from "data.txt" with delimiter "\n"+ S. O* d0 ~8 A0 _3 t
        read A_time from "data.txt" with delimiter "\n"3 B4 s9 y1 _4 G$ ^% U( g
        read A_leave from "data.txt" with delimiter "\n"
# E) r/ b; A) d! \/ l        read A_picks from "data.txt" with delimiter "\n"
: Z- `$ _9 X2 ^# P. L        set load type to A_tote
; a7 f5 Y( G% _+ _# [        if A_tote="tote 1" then set A_induct to 14 |3 f8 E6 E2 k$ N& D+ L
        else if A_tote="tote 2" then set A_induct to 28 F. P/ w9 S% L- Y
            else set A_induct to 3   
7 C) G& M2 ]9 c0 F        set A_i to 0
. ?' o& H) D7 Y7 f9 Z        clone 1 load to P_induction
) c; S) a' i9 Q7 `9 q! e        wait for A_time sec' B$ A' T" }5 }; \
    end
: v8 }& n4 i5 |. u+ Z3 ^end3 }- t+ B4 ?4 o; e* s

+ N1 W! ~+ C$ D7 h6 t; Ibegin P_induction arriving
- ?2 n4 O; u0 J* F. U    if A_induct=1 then clone 1 load to P_pick1
. h  y* V- u/ L+ M    else if A_induct=2 then clone 1 load to P_pick2
7 p; x1 n# z3 L- g6 @( P9 B9 A        else clone 1 load to P_pick32 t3 l, L# o+ j1 Q( E% L
end6 g+ x( ?( F+ E; b, c3 V
' v" k3 N- i) r
begin P_pick1 arriving
" S& f& M9 D3 W) `5 b& n" ^# n6 K8 x    set A_i to 1" ^! \' x+ h# r, ?$ t$ e2 A4 K( t
    move into Q_induct14 f. v8 ]7 p$ {% \
    move into pickaisle.induct14 \2 T3 W9 ?/ M" W* I8 h
    while A_i<=30 do begin
* C/ y* t$ T0 u& g2 p        travel to pickaisle.con(A_i)# ]% Z% d1 n/ G: ?. o2 y
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
$ ^( V4 r' |( ^3 @: t# g2 Y6 @        else wait for 10 sec! S) @, @# t9 x! c
        if A_i=A_leave then send to die0 _. p, a1 Y$ M- D# R  _
        else inc A_i by 15 }# g% s2 I2 j$ m' z  L& [2 q7 o
    end% R# b! o$ C7 I
end9 X9 ]) {( U0 r! \

/ d$ `4 V* s+ b' x7 lbegin P_pick2 arriving
3 b7 n+ J4 v! m, `! [    set A_i to 11: q+ f( ?* l: e7 S! u3 x3 s/ Q
    move into Q_induct2- ]5 u, G, C4 N& S+ a
    move into pickaisle.induct2' ?8 E- X' I) v! s; N
    while A_i<=30 do begin
: E+ }0 p- Y3 [5 p+ x% O5 U, d4 b: w' C        travel to pickaisle.con(A_i)4 i5 F9 |3 }9 ^, m1 i/ Z
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
4 M- N. Z. s* x+ O0 h        else wait for 10 sec
7 ]) ~% X; A1 X# R$ r! B        if A_i=A_leave then send to die; i- ^7 i: l# y/ K8 q8 ]; |
        else inc A_i by 1
& z3 E' `  }! s$ S    end5 D! m( B, L+ }- o
end7 K' Q3 @" M5 ?6 u

$ J/ p/ p1 T& {$ r% Nbegin P_pick3 arriving0 S, l" [. }/ w' l( p- I% G
    set A_i to 21$ C3 }4 x, `4 n1 r: W
    move into Q_induct32 ?! z. `! B5 P, d
    move into pickaisle.induct3
- ]8 s. o" ?  `% ?    while A_i<=30 do begin
6 B# c2 v7 j" q2 a        travel to pickaisle.con(A_i)5 _+ {$ Y7 A- g0 G# e. f* q
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec  X5 V: R! z& [& _: G
        else wait for 10 sec
( T  F0 S" u! |" a/ y2 ~        if A_i=A_leave then send to die
6 n6 h$ ?4 L3 G# M5 D; R. s: K        else inc A_i by 1
! q* f( O& N4 [    end. o/ O6 ~6 b: `( k! t
end

最佳答案

查看完整内容

pickaisle.induct1/2/3是个什么东东? move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么? AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。 另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量: 1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的 ...
发表于 2009-4-4 23:58:33 | 显示全部楼层
pickaisle.induct1/2/3是个什么东东?
; Q; s4 C! v  |, V9 xmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?' I, m9 |' D8 {! j' b5 c3 l) _

" a  S8 y$ G+ }0 oAutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。. F9 a. A7 ^8 `/ ?) [( ]

4 A" V+ _. a  a4 C& I! n另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:+ s. c) r# a! G: e6 m
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
% l, d+ T+ h$ D1 g2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
/ G/ R: S0 H! c0 z8 A$ r3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:9 M* b6 u1 S# ^" {- x
begin P_induction arriving' v8 J& L, m& C) ~, ]! X
    clone 1 load to P_pick(A_induct)
5 H8 N4 Z8 q9 e# q9 c1 Zend最大的系
5 q) d; c: k+ B6 j# f
) {! ~" \: d$ f* w$ U$ t0 k) q1 \: Q1 Cbegin P_pick arriving
" P+ V3 @9 T  N/ c2 ?- j/ w) j; N    set A_i to procindex * 10 + 13 a" R0 }$ t( p' @8 s3 a2 m
    move into Q_induct(procindex)! Z, Q8 [0 s, Q) q
    move into pickaisle.induct(procindex)
3 n4 @9 F  j/ {* q" y. g1 i" ^    /*check the type of pickaisle.induct(i), for your last problem.*/! M9 J! Q8 {6 r; V2 s- @

) A" b1 D: B5 _# g, \3 v; i    while A_i<=30 do begin- K% Q* Q$ W/ l2 w! A  W1 P: X% F
        travel to pickaisle.con(A_i)/ C8 W' K, s% O5 n* _
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" g5 S- i7 l9 }% O1 d; G) R8 O( B
        else wait for 10 sec: s1 Q- b; X6 x* u2 r/ h3 r
        if A_i=A_leave then send to die/ c( H2 y) M2 `3 |: J/ ]
        else inc A_i by 17 E" ]4 y' a1 b( U; ~6 |
    end8 r- U$ Z! ^7 p, x
end2 k4 V1 Q8 o* F( G, T! b6 z( X9 L
' j' I& W( Q$ H2 N. H  b  X
其中的procindex为整形,代表当前process的序号。2 L8 F) _$ g3 l0 k- z
station和control point只要以数字结尾,都可以直接用作数组。如pickaisle.induct(procindex),当procindex为1的时候,和pickaisle.induct1是等同的。
发表于 2009-4-20 15:33:32 | 显示全部楼层
你的主要错误应该是在move into pickaisle.induct或者 travel to pickaisle.con这两个类型的语句中,因为你的编译说明的意思是类型混淆,你查一下报错的行数,应该就能找到问题,其他的问题慢慢调吧
您需要登录后才可以回帖 登录 | 注册

本版积分规则

QQ|Archiver|手机版|SimulWay 道于仿真   

GMT+8, 2025-11-15 22:27 , Processed in 0.020269 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

快速回复 返回顶部 返回列表