设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14160|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢& p$ B8 X  t, J8 R% H% d; r6 ?! K

& v/ ]" M7 n8 J9 T" e9 f' j+ a我的问题是,在每个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中的数值,不知道会不会有什么不妥。, ^" s! {8 H  Z9 X5 Z: Z1 w# y

) f/ Z8 I$ E1 zbegin P_read arriving- S' K( @0 c# G2 {' g# w' H
    while 1=1 do begin' m# o8 _' }. `# c
        read A_tote from "data.txt" with delimiter "\n"4 o; j) R4 C* Q# k+ j8 V
        read A_time from "data.txt" with delimiter "\n"
; K' Z7 t* t, ~; W        read A_leave from "data.txt" with delimiter "\n"4 ?8 Y1 H4 L3 u0 M$ [4 ~" B7 Y/ k
        read A_picks from "data.txt" with delimiter "\n"( H7 \0 C4 V( y; D; O. t2 `! k$ s* Q- I, R
        set load type to A_tote$ x2 z/ n* C& f' _" E
        if A_tote="tote 1" then set A_induct to 1. e0 Y! w5 N! T# g8 R3 y4 X
        else if A_tote="tote 2" then set A_induct to 2
% R. O4 {# b( Z/ v! Q* c1 ~            else set A_induct to 3   
- w  L* z& J$ v, V3 a        set A_i to 0
3 W! a, {: \: w4 H) \) b4 R        clone 1 load to P_induction2 |9 J& _$ u% A  _& P& r5 g9 A1 {
        wait for A_time sec
& ?$ g$ @' `( J, a0 m    end" B$ ]7 r$ V& Y8 R* f* L$ J9 a
end
  x4 _3 Z" r) t5 x0 T/ ^( w: T8 N+ C# [  U
begin P_induction arriving' X9 T" f# R! E9 S( Y3 e3 J8 C
    if A_induct=1 then clone 1 load to P_pick1
( j; W& Y) f% ]$ g8 b. H    else if A_induct=2 then clone 1 load to P_pick21 U& L0 C9 F: u2 \3 h
        else clone 1 load to P_pick36 T; z' n" o, q3 v3 ?4 @% k
end3 X. W# E4 }2 k1 o: q2 g% }8 B

: K( E4 p! x- n$ p' U6 ~- ]7 sbegin P_pick1 arriving
, [8 i* a& T5 v    set A_i to 15 n: D, \1 e$ m/ H
    move into Q_induct1
: J) P4 C# Z4 @% s  O    move into pickaisle.induct1
. x+ A; B! z- V- l8 _! p. }    while A_i<=30 do begin( S$ O7 S- M# W% C2 K
        travel to pickaisle.con(A_i)3 b0 e4 ~$ P4 t: Q1 }  d
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
( U7 x$ i4 s, n' S3 i        else wait for 10 sec
  X7 u% p7 Y& \+ E3 M5 |, H; F: u3 p        if A_i=A_leave then send to die
+ z# ]) f$ }% u, L6 @# g        else inc A_i by 1% r7 ]* a8 n) d" t$ J' T
    end3 H. ~; S8 d# f; y6 ^2 p) Y4 o
end
+ }6 O! }" A' G$ |1 ]& O+ P1 l$ a  [
begin P_pick2 arriving
# K4 C$ H# [3 V8 w/ k( K/ U    set A_i to 11
4 {  H8 I5 z" |0 X" d3 T: b    move into Q_induct2$ _9 V8 M( o' L+ g
    move into pickaisle.induct2$ B3 y- n7 G8 n* u* ]
    while A_i<=30 do begin
  h) X: k- w% {, c        travel to pickaisle.con(A_i)* X0 ]! m( K& m; l3 d' ~& T
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
: q$ E* G7 M( ]1 v        else wait for 10 sec
/ L5 U! i  B4 B( F* N4 c8 F1 Y; U        if A_i=A_leave then send to die* z( }  T; H" S7 X
        else inc A_i by 1+ h7 V! D: b' z- z2 R( j
    end
; v, h1 U1 ]$ x% H  {: Fend
& i% n( ?0 U( u9 d2 I
" p0 I$ q$ M& p3 e0 Q1 w) t" X4 x/ tbegin P_pick3 arriving5 O3 Y& Q6 k* l  o
    set A_i to 21
8 V! k0 U! N' g! N; X+ Y1 y; d" q5 [    move into Q_induct3
" {: U  y! q; b, @0 x    move into pickaisle.induct3
( a/ {1 p! I% e4 x" ~    while A_i<=30 do begin
6 x  x+ u6 k: {6 R  u* A, s1 ~, `        travel to pickaisle.con(A_i)
& d) R* k! p4 }- _% f% F        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec8 P( O: ~. e2 [4 o3 \+ z3 y0 J' a$ Q
        else wait for 10 sec( b; o- H) a7 a6 g* {' ^
        if A_i=A_leave then send to die1 E2 P3 g, C6 ^3 w! R- A1 b
        else inc A_i by 1
4 r2 [/ w! v) B    end0 Q9 g. B6 P# u( o2 K
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是个什么东东?; V9 b5 Z1 V* [& F& |3 @& m
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
: ~5 a9 o% Z2 O$ J. p/ G5 W4 \8 e6 F# H/ E$ D! ^' s" V
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。3 ]9 q+ A9 ~) [% F% s
- L' y* i' j$ ^# Z" p
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
" m: `3 e% ^8 v! O1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;4 [$ x7 Z+ q5 W9 a
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;: S4 L7 h, |* X, E
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:
) J* \" ~5 M2 O( U7 a. E0 _0 Gbegin P_induction arriving
9 l" e- Y# p2 G  _    clone 1 load to P_pick(A_induct)
3 `" y" t* z5 K. m3 W9 t) Tend最大的系
6 K3 p% W, i, r: J. S* |  i. J
4 m; |* Z" t: e$ n2 t; J; kbegin P_pick arriving
9 P. n$ U# |$ R    set A_i to procindex * 10 + 1
& u' n$ Y0 `, f7 Z) P5 Z: [% D8 W    move into Q_induct(procindex)
/ I% n6 r) S5 H& D4 Z0 r    move into pickaisle.induct(procindex)
: C0 U5 z; j( V) k% D    /*check the type of pickaisle.induct(i), for your last problem.*// N4 e" ]( F  n  Y& V

& u4 {3 f2 b* l. z% O& Z    while A_i<=30 do begin  v) N& L- W  U+ S) |4 |1 b5 U
        travel to pickaisle.con(A_i)
$ k) E: Z1 S% p) m7 O1 x4 w        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" S2 ~1 R$ I* ?  w( h: |
        else wait for 10 sec2 X3 ?  O" o7 \" O: J
        if A_i=A_leave then send to die
8 E+ d* h% Q- T; o( R' ?6 m        else inc A_i by 1
. ^6 l% f4 g3 K! f    end$ ?) w: B. `! K& [$ ?) w
end0 B) P. Q$ C+ i8 `& x6 X: a
& J/ D2 X4 ?) z! ?
其中的procindex为整形,代表当前process的序号。+ T4 i5 R; z7 z. S/ Y# Q
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, 2026-6-15 22:20 , Processed in 0.014972 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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