设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 14806|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
: P9 o- h2 A$ Z2 z' x) j4 q
* N" H' k5 Z+ h$ t5 ~* W' i( V我的问题是,在每个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中的数值,不知道会不会有什么不妥。) P* y8 d& G% \4 q
- I2 k9 H  `) ^- i& S# N
begin P_read arriving
7 F5 G1 Y( f. p    while 1=1 do begin" Q; a) O$ }1 y  r$ P" \
        read A_tote from "data.txt" with delimiter "\n"
, G7 |# L/ q  [6 R7 L        read A_time from "data.txt" with delimiter "\n"
6 g6 E  I; L5 d        read A_leave from "data.txt" with delimiter "\n"& Q$ I$ i# |4 y: |* C' |
        read A_picks from "data.txt" with delimiter "\n"
& _2 F9 ?& Z% r/ s, B0 n! B* ~        set load type to A_tote
9 t. H# W; {( a, X        if A_tote="tote 1" then set A_induct to 1
* f' c: F3 G) e8 S: U/ p6 A        else if A_tote="tote 2" then set A_induct to 2
) r% f8 ^7 s: j. I) ^$ J- X            else set A_induct to 3    : A! U6 ~; t1 u5 f
        set A_i to 0, g* R" i* U* h1 W" p- Y
        clone 1 load to P_induction) H  E. d, O* h5 D, _3 E
        wait for A_time sec8 U& m, v6 [/ g% U8 C
    end
& J8 B5 [% P9 R: G/ O* E( n* w0 R" cend; j) D; |4 S% H" ~

, v$ J: d  w3 bbegin P_induction arriving
5 p. C$ r6 U7 u4 G+ B; s    if A_induct=1 then clone 1 load to P_pick1
( h! S. _3 L# A; p    else if A_induct=2 then clone 1 load to P_pick2
2 M  Z+ Z" [; m, N6 `7 n2 B' |        else clone 1 load to P_pick36 T8 C. S3 c+ N, b! k
end, A. h- }/ c' Q+ I. g+ L2 }' ^, m4 L! q- [
4 k: T; x5 b- N0 K+ t, q; C$ v, W
begin P_pick1 arriving
( F& X, Z5 E$ {0 _- q    set A_i to 1- B. U  @7 @0 W( t5 m
    move into Q_induct1; ~' ~6 A4 u" }
    move into pickaisle.induct1; i2 G" m$ `) f
    while A_i<=30 do begin
) b2 ^( ]4 [0 l) u! e        travel to pickaisle.con(A_i)6 I( ?( C9 z. N; G5 l+ V" ~
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
& T8 N* l6 J! ?& G( ?* b9 {        else wait for 10 sec
+ z. q, p; T* K& C0 g+ m5 R6 Z        if A_i=A_leave then send to die0 n' ~2 H# v9 R3 t7 M* v
        else inc A_i by 1$ j$ j% j8 q1 T0 t
    end8 }# Z$ c1 H, c5 g
end
% C2 T9 \; H( W$ b7 s  o
" P+ [# j( F1 g. i+ U" J$ Abegin P_pick2 arriving
  b6 t$ ?8 F3 L3 Z3 X& q$ `    set A_i to 11( B" z8 `" u2 K5 y& {" j5 b
    move into Q_induct2
3 g  m5 n1 o) Q  j    move into pickaisle.induct2
2 S( c9 S7 A$ f) C3 l    while A_i<=30 do begin
$ d! n0 V0 J- V% `4 [0 N  e4 d0 D" t        travel to pickaisle.con(A_i)
$ T+ d/ i: _1 r7 O: [        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec6 m& g) d  T& \
        else wait for 10 sec1 p8 q! @$ w3 |  W" L' {2 [( p5 [
        if A_i=A_leave then send to die  |; W- L' ^- A; ]% L# A. L: k
        else inc A_i by 1
) e" l% n5 T. l# x1 {    end
* g$ D" V) i. U5 F9 r: gend. a5 _5 h! o1 E( o# _5 ?/ J

! l' _, a  _- nbegin P_pick3 arriving' M5 M4 D; Y# d3 I
    set A_i to 212 v1 K0 D' v$ b# u" a
    move into Q_induct3
0 I! d2 y% N, c% @* @2 O# c! l    move into pickaisle.induct3
( I. \! r9 ~: J* S# z    while A_i<=30 do begin
- H- L' U7 f- n7 L7 A        travel to pickaisle.con(A_i)6 D( t5 L- Z7 h3 V' R$ M
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec% z" T/ P- ~- c
        else wait for 10 sec0 L) p# ~8 ?. t* s/ v
        if A_i=A_leave then send to die
* ]9 b' R% b- R0 @6 f9 a' A% G        else inc A_i by 1
) }  E) Q- R1 n4 w" V7 f    end
. ~$ V0 H; B4 `+ s. Yend

最佳答案

查看完整内容

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是个什么东东?
' k; u! c' H0 }  N" mmove into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?
& h0 X3 Y. c" m" d8 _4 }6 y7 r& ?% D& B8 Z& f8 w8 p& r4 ?
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。8 z8 U# i3 g4 R% a' ^
7 P$ i+ c$ ~. ~  ]1 O
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:3 Q3 d0 `) ^$ f" g' q
1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;5 s3 {' L; M* G% a( Z5 F2 j9 Z/ E3 g
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;) k- `0 f7 I1 E
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:( \4 P$ O6 Y. U- Q
begin P_induction arriving
) [3 w  i: l5 E    clone 1 load to P_pick(A_induct)
1 v. I7 q2 C) T+ O+ Lend最大的系
2 j, @3 _  [) N# }" G( I
- L+ {, r7 S7 d& f/ jbegin P_pick arriving
1 Y& {- i( z5 x; s5 N    set A_i to procindex * 10 + 1
& \  \: K5 i7 n* G# n; b    move into Q_induct(procindex)
1 L+ n4 f4 D7 i: J/ W    move into pickaisle.induct(procindex)
, x" [# \2 C0 G! J/ ^" c+ \& _    /*check the type of pickaisle.induct(i), for your last problem.*/$ ]* J* `- ?+ l& [; A: s2 C# Q7 Q8 _. e/ s
2 q" g. _7 o. D0 d3 L( T  p6 m
    while A_i<=30 do begin
5 m+ _4 u2 p, @" W1 e, `        travel to pickaisle.con(A_i)
7 m3 @/ e3 F. D6 ^# F7 t        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec0 f) m7 B' `4 Q  `3 F9 q- a
        else wait for 10 sec
5 q2 a! v$ t0 n$ _) N4 I5 s        if A_i=A_leave then send to die( Z+ u3 l* {- O4 G5 X6 h& s9 i% x
        else inc A_i by 1
. j% P! g3 [" ~9 A" S  v6 v    end
* X! ^2 W3 W' v7 }$ x( h. lend
. Y7 a4 V* t( A& ~  p& _& H3 F! `
; o% q6 v+ z, M: `+ e- h6 E; ?" s: s其中的procindex为整形,代表当前process的序号。
; q$ c& M# x7 \( x7 tstation和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-7-27 07:29 , Processed in 0.015196 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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