设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 13906|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢5 S' ]8 |  t* W* Y6 E# j+ A
  [% q& u& _) @; k% o; d
我的问题是,在每个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中的数值,不知道会不会有什么不妥。% T& B" }; k8 ]1 l

4 E, I, u6 t- [5 L5 Cbegin P_read arriving
0 i2 X/ ^% B, p6 S    while 1=1 do begin! V+ Z% C" j4 W9 {9 h  S
        read A_tote from "data.txt" with delimiter "\n"6 ~1 |8 Y/ ?" R) |! M9 d
        read A_time from "data.txt" with delimiter "\n"
% z( P0 D' e' z& V' v( x! l        read A_leave from "data.txt" with delimiter "\n"; {5 Y6 l7 \% l) h  X% ~& O7 ]
        read A_picks from "data.txt" with delimiter "\n"! x4 K# C( Y, ^# _  p
        set load type to A_tote3 p( F& k, i5 l5 g
        if A_tote="tote 1" then set A_induct to 1: c5 N4 f" Y5 D6 E# @7 P
        else if A_tote="tote 2" then set A_induct to 2! _  z. o5 U+ I$ \% t
            else set A_induct to 3    ; A) k9 ~3 E# x7 d  a
        set A_i to 0
( v) x7 \0 p8 y" E& u        clone 1 load to P_induction
2 ~2 Q1 t8 H, M# U' t. U        wait for A_time sec9 u- o3 R9 n; I) ?
    end
7 p1 y# D$ S1 L$ uend
* d: U% X4 L  \* C. [1 ^7 V, U
6 N' N9 y; t, K, ^3 ]begin P_induction arriving
# [) q1 {! W# S9 ^: i0 G    if A_induct=1 then clone 1 load to P_pick1  l& I6 Z) V& Y  ~9 m
    else if A_induct=2 then clone 1 load to P_pick2: u7 \% ~! a+ D+ w' v- h* d
        else clone 1 load to P_pick3
* r- u! Z% s$ u% Mend* e3 Q- [0 k9 e' _+ X. L

# U1 b/ |1 Q1 t+ mbegin P_pick1 arriving
) [- x2 v% m6 R- u7 U* Y    set A_i to 15 r0 N8 l+ m! K! m" i' L+ {
    move into Q_induct1* B, ?( H+ `* p% y/ E# P
    move into pickaisle.induct1
, t3 [: i: K2 W/ F7 z1 f9 `: u    while A_i<=30 do begin
: l2 l2 `& V  x/ q2 `, ~6 ^3 i% z        travel to pickaisle.con(A_i)7 r4 j$ T% L- O7 n( a
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
3 D+ e! C5 Z# _9 a( C$ j% P        else wait for 10 sec
0 r% X5 N+ N2 V  `" L5 R        if A_i=A_leave then send to die6 O$ i, x8 F% e
        else inc A_i by 11 B& |  F2 b* |5 B2 r6 E0 r- |! H
    end9 Y. S. J1 e4 I- \, M
end. G/ P) O4 \1 S1 j' \, t8 H
  [  Z+ a& L9 d  O0 r: Q: [
begin P_pick2 arriving, X. D" P4 R8 E( a: B
    set A_i to 11
( B# T% k+ J1 O& r2 _6 m    move into Q_induct2
' u1 r( U7 Z$ ?* t6 Y9 \4 Q2 u+ g  R    move into pickaisle.induct2
7 z; [8 w$ M# J4 V9 l3 Y    while A_i<=30 do begin
6 S* Q8 y9 u, Q/ S5 Q) y7 ^( ^! d        travel to pickaisle.con(A_i)
4 f" p- B4 t% r7 d3 b        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
. C  W) W1 C, x0 a% a        else wait for 10 sec8 Z0 Y: K3 t: B. [# N* ^
        if A_i=A_leave then send to die
$ [4 x6 a% C5 }- B- ^* h        else inc A_i by 1
$ j0 V# K5 `4 u6 F    end
. O- W) n  L& x" Dend
8 Q" Z) w3 e# W. ~) N/ w
+ g. R, L- H; E8 J' \  A! Mbegin P_pick3 arriving
2 M7 [) |1 ~3 }! L  M    set A_i to 215 z3 Z# t. m: k, O: ]
    move into Q_induct3
1 K/ y1 [6 I1 r7 G7 N0 U    move into pickaisle.induct3
; D$ K, T$ g" [* F3 W    while A_i<=30 do begin# z+ y9 h1 ~2 Y/ h  t: D/ |
        travel to pickaisle.con(A_i)
  R2 B2 k2 V/ Y. I+ R: q$ K        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec" q2 [/ p# ?# ~) g* k$ |; b
        else wait for 10 sec0 q8 I- [7 A+ k
        if A_i=A_leave then send to die) h8 E9 [, h0 b. a8 F  f
        else inc A_i by 1" G* Z/ c# K% [* S) d
    end
9 E5 I/ j- ]+ u( j, T; \' Pend

最佳答案

查看完整内容

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: p, p/ f& Z7 F
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?& g4 C  c* C6 d8 f. V1 d8 i
5 X0 k4 E9 @  E+ j$ n6 Q* d
AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。  V7 |: a' q! K' ?* f
( @# ~+ C% R  X" [+ k; o
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
! A! N+ w  J+ t5 y0 w1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;% p! ^8 T( M# q9 x2 ~* z) J& Q  M
2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;
; k; J9 P5 P/ N- s  I4 [  ^3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:/ W: @. J+ [7 V# P- H" B
begin P_induction arriving
/ A4 t- q: o# v/ M! p0 G6 X$ M) Q    clone 1 load to P_pick(A_induct)8 F; s$ ^6 S: C3 z
end最大的系+ z7 R1 A4 C% j# x* |5 u
0 i+ ^7 s5 v' N$ }9 [# h. q
begin P_pick arriving% T  P: t& s0 O
    set A_i to procindex * 10 + 10 `( X# H9 U1 S3 y0 C8 ~. ~+ l
    move into Q_induct(procindex)
# z1 Q0 |/ F7 Q) p! l1 U, {7 Q/ N& Q    move into pickaisle.induct(procindex)
- g" T% I; J/ u" G' E4 y& ]    /*check the type of pickaisle.induct(i), for your last problem.*/7 W* A8 N. i: d5 d/ w: {  t, B
" G2 f0 a4 y+ W# Y/ B* p4 d. `7 ?; O
    while A_i<=30 do begin8 X6 G, l$ n  v! x. P- {8 X! E
        travel to pickaisle.con(A_i)
+ M8 d1 y* I, [* g8 C7 a0 Y        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
8 l$ c1 R$ P  x$ r' J8 h8 k) @        else wait for 10 sec
1 r5 g% G3 Q& S. a        if A_i=A_leave then send to die, C! F4 {- O0 @: K3 `3 h5 y
        else inc A_i by 1* K, ?. ~5 ^( W+ d/ l5 w" Y+ o
    end1 z7 T/ P( V3 Q) ^6 K
end
- o+ H" i! }. Y  A! J; n% a& R: S2 f6 J1 p( y3 r5 u7 U
其中的procindex为整形,代表当前process的序号。# _. ]5 f$ X$ F7 o
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-5-17 15:24 , Processed in 0.016943 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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