设为首页收藏本站

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

 找回密码
 注册

QQ登录

只需一步,快速开始

查看: 12375|回复: 2

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

[复制链接]
发表于 2009-4-4 23:58:32 | 显示全部楼层 |阅读模式
5仿真币
想请版上的人帮我看看我这段code中的一个错误,我刚学Automod没多久,实在找不出错在什么地方了,谢谢
- v9 ^0 K: {: j8 J, f: D% s4 @  Q
我的问题是,在每个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中的数值,不知道会不会有什么不妥。$ _$ F, M+ l& q* N' n- ~

5 g( S: c) x! U* w; [4 `begin P_read arriving
# L: Y) W# p6 c+ i' @3 O8 q    while 1=1 do begin
  z& n& n& I1 V) V+ e3 q        read A_tote from "data.txt" with delimiter "\n"- S  X2 ^" y' B8 Z
        read A_time from "data.txt" with delimiter "\n"
2 l! `( @& ^- X" A9 s0 ~        read A_leave from "data.txt" with delimiter "\n"
$ I0 F! ^" g$ d        read A_picks from "data.txt" with delimiter "\n"
- O9 j" W  b, E        set load type to A_tote/ u2 Z! C! F1 [4 {3 _& G
        if A_tote="tote 1" then set A_induct to 1
$ I* [% o. h& ^6 _2 I        else if A_tote="tote 2" then set A_induct to 2
5 g6 [9 T. M. J  R: Z4 }            else set A_induct to 3   
' c4 I7 b, {& }        set A_i to 0
  m: p1 u6 ?) l6 S( Q: x1 A        clone 1 load to P_induction
* C' c5 S: Q1 L& N        wait for A_time sec
+ D; k8 l. i% N    end
" S( J- R  |# l. R: I% h+ i, }8 I$ Oend) E% L! d2 Q( @4 k1 g

1 ^; e. f+ \3 n' w9 Fbegin P_induction arriving
6 S. W8 E  Q" a6 l& Z+ m    if A_induct=1 then clone 1 load to P_pick11 b1 l( e" m# `3 z3 ]
    else if A_induct=2 then clone 1 load to P_pick2
1 L) I! l7 d! f& g3 C        else clone 1 load to P_pick30 R3 f& c' e8 R: a3 r& q
end) j1 ~, r$ h3 Z  B

6 z0 b# c; Y2 E2 c1 K* B0 r, c" Hbegin P_pick1 arriving
% P* R9 W4 i, o    set A_i to 1
8 l7 i8 a) I. g    move into Q_induct1/ h$ s2 ?: ~& R* l9 |9 }1 q
    move into pickaisle.induct1$ B) B. T* q" N8 J2 p
    while A_i<=30 do begin
% Q8 _& U, |7 h6 ]        travel to pickaisle.con(A_i)/ T) ^4 |( T, h
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
- _9 H# g1 ^0 R+ J8 S+ ^* C# D4 O! |        else wait for 10 sec
: l0 f( q( f" H0 W  ^7 |6 `# p        if A_i=A_leave then send to die- ~; F, L$ |' Q
        else inc A_i by 12 X9 u0 {6 E+ ~. {7 c. Z0 c
    end3 f" u& _+ U; `) n( j
end
1 G! j6 @& h! j6 i" Z# H) y; E: n4 C
begin P_pick2 arriving
+ ]5 i9 t: t& \4 V    set A_i to 11
, |0 b- N/ m$ A! \* V    move into Q_induct29 h- {* x5 T" ?+ ?
    move into pickaisle.induct2  W0 ]7 V9 y' b, W# \6 s0 M% j
    while A_i<=30 do begin
/ H. ^) {( S! h  U- s+ o        travel to pickaisle.con(A_i)
5 `. h' ]7 j2 `# E2 i+ w  {        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
" t! ~* B1 x* p, w0 G0 i        else wait for 10 sec
: g9 p. J) V& H" E/ \' [; i% g7 |3 r        if A_i=A_leave then send to die6 D) C8 a) O3 W5 ^" V) m
        else inc A_i by 1. @7 W9 R  x. ]3 f' H
    end
$ }! w8 ?5 z! i) _6 R! b8 l3 Pend
6 u" {. w% ~2 n: K+ @  k0 ^& Z
! E) i  N! L  s* O3 M: Jbegin P_pick3 arriving
( M6 {  _+ H; P6 ~% d# j    set A_i to 21) x7 |/ D! U9 [0 n: c* k, Y% `- Q
    move into Q_induct3
  R8 X% N) {( o3 ~    move into pickaisle.induct3
$ @' G4 x+ |) Z! T, E8 O3 u/ W0 M# f- M    while A_i<=30 do begin
, K, b; [1 q  K! X        travel to pickaisle.con(A_i)8 v+ Z- g! f: ?6 n, _4 L
        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec7 t8 K5 U) B+ j
        else wait for 10 sec6 @/ q: D6 D+ S- j
        if A_i=A_leave then send to die
1 z* A3 A/ ?$ Y2 j# Y1 F& \4 P" z        else inc A_i by 1. ]5 k9 K6 j; z) f
    end" `$ J# n! z8 V2 ?
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是个什么东东?6 y7 P4 X6 E' Y  J( Q7 Q
move into后面,应该是一个station或control point,或者Queue/Container/Vehicle/Segment之类的东西。看你的报错信息,这个induct是个path么?- S/ w7 v' a' b1 [- h2 e, y& g3 t$ ~

9 d' r2 @% ]! l% y1 D1 ]AutoMod Editor的语法报错信息,有时候会指在下一行,必要的时候要把上下几行都看一下。
& C# U4 a9 U  [# D" E( r- k+ Q( U3 o2 r% [
另外,你的几个P_pick是完全重复的,建议以如下方式修改,可以减少代码编写量:
4 {: _" L9 y2 J3 G4 Z1. 创建一个Process:名称为P_pick,number of Processes为3,其它按你的需要设置;删除那几个P_pick;
6 B$ m: W. V0 y- X, {2. 创建一个Queue:名称为Q_induct,number of Queues为3,其他按你的需要设置并放置;删除那几个Q_induct;' {2 {( R5 `4 `. ?2 [+ P
3. 以如下方式改写P_induction和几个P_pick的arriving procedure的代码:1 M; X4 `# O) l7 D. T
begin P_induction arriving* p  D, U8 u, O' L9 h& y' R; k
    clone 1 load to P_pick(A_induct)
/ l6 m/ L* ~" a5 _/ `' t) o8 Eend最大的系
: Q5 B- T3 A3 b( ^. ]
# m8 `0 M# p! w/ l) x# {7 bbegin P_pick arriving
: v4 j4 ^" K' n3 E    set A_i to procindex * 10 + 13 j4 a2 h7 i4 Y
    move into Q_induct(procindex)
0 [8 d3 L/ A4 `    move into pickaisle.induct(procindex)
( f& P* U: n" H8 U4 x4 S- ]  ~    /*check the type of pickaisle.induct(i), for your last problem.*/
0 J9 Z+ i2 a& L  Y! k% H8 a
4 |3 @! G4 p. w/ L3 ^4 @    while A_i<=30 do begin) z8 F' |5 p% E: B" G. ~
        travel to pickaisle.con(A_i)
6 P# ^/ l& l% X0 I        if A_picks(A_i)<5 then wait for 5*A_picks(A_i) sec
* s5 e# l5 r0 w        else wait for 10 sec
" @. N4 Q2 ^$ s# T* w  g) |, J        if A_i=A_leave then send to die4 c  V% e) S9 t9 l
        else inc A_i by 1
, J1 A5 ~9 ]' Z8 a! d7 @    end5 b7 p0 c+ h2 T1 A
end- L9 @: U/ N' Y0 u. v, i# s
6 t' M1 c+ ~* X- o, b! h
其中的procindex为整形,代表当前process的序号。4 |+ _6 ]. }) }. I. q% M
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-1-19 16:48 , Processed in 0.016281 second(s), 14 queries .

Powered by Discuz! X3.4 Licensed

© 2001-2017 Comsenz Inc.

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